Tuesday 08 April 2003 6:25:06 am
You can attach onload events with just scripting. window.onload = someFunctionPointer; If you need multiple events, then you'll need the DOM methods attachEvent and addEventListener, neither of which work in Opera 6 or less and IE5-Mac.
if ( window.attachEvent )
window.attachEvent( "onload", functionPointer );
else if ( window.addEventListener ) window.addEventListener( "load", functionPointer, false ); Of course, for any function-pointer resource you can substitute-in an anonymous function. Also, the onload event handler applies not only to <body>, but also to <applet>, <embed>, <frame>, <frameset>, <img>, <link>, and <script>
|