onLoad Event handlers
<body onload="inform()"> //Execution of code //will begin after the page has loaded.
<frameset onload="inform()"> //Execution of code //will begin after the current frame has loaded.
<img src="whatever.gif" onload="inform()"> //Execution of code will begin after the image has loaded.
Lets see an example of an onload handler:
<html> <head><title>Body onload example</title> </head> <body onload="alert('This page has finished loading!')"> Welcome to my page </body> </html>
sometimes it is necessary to wait until the entire page has loaded before
that script is run to prevent any potential problems or make sure the aspect
of the page you're manipulating has been downloaded. This is where the
onload event handler comes in handy.