|
onLoad<BODY onLoad="...">onLoadonLoadFor example, suppose you want to run this command when the document is loaded:
alert('Hello There!')
and you also want to run this command:
alert('Howdy!')
You can do this by putting them both in the onLoad
<BODY onLoad="alert('Hello There!'); alert('Howdy!')">
If you want to run more than two commands, just put semicolons in between all the commands. However, this tends to get messy, so it's usually a good idea to put the commands in a single function and call the function from
onLoadinit() by putting this script in the
<HEAD>
<SCRIPT TYPE="text/javascript">
function init()
{
alert('Hello There!');
alert('Howdy!');
}
//-->
</SCRIPT>
Then you can call init() with this
onLoad
<BODY onLoad="init()">
Copyright 1997-2002 Idocs Inc. Content in this guide is offered freely to the public under the terms of the Open Content License and the Open Publication License. Contents may be redistributed or republished freely under these terms so long as credit to the original creator and contributors is maintained.