Multiple onload event in dot net


Once a page has been loaded 'onload' event executes a JavaScript immediately.

We can use onload function in number of ways:

1. <body onload="load1()">
2. <element onload="SomeJavaScriptCode">
3. object.onload="SomeJavaScriptCode"
4. window.onload = load;

function load1() {
  alert("This is the first.");

onLoad Event handlers Examples

<frameset onload="framload()">
<img src="logo.gif" onload="imgload()">


USE of onload


This is used to invoke JavaScript function after the page or an image has finished loading.