Running a Script from the onLoad Event Handler : HTML Body Event « HTML « JavaScript DHTML






Running a Script from the onLoad Event Handler

<HTML>
<HEAD>
<TITLE>An onLoad script</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function done() {
    alert("The page has finished loading.")
}
// -->
</SCRIPT>
</HEAD>
<BODY onLoad="done()">
Here is some body text.
</BODY>
</HTML>


           
       








Related examples in the same category

1.Using the fireEvent() Method
2. onBlur and onFocus Event Handlers
3.Using the onSelectStart Event Handler
4.Calling to Display the Alert Dialog onLoad
5.Calling to Display the Alert Dialog Directly
6.JavaScript Event Handlers :Loading/ Unloading a Document
7.Handling Load Events in a Content Document
8.Using Event Bubbling with the onClick Event
9.Using addBehavior() and removeBehavior()