M
Michael Landberg
Hi
is it possible to load multiple onload events in the body tag?
Regards
is it possible to load multiple onload events in the body tag?
Regards
is it possible to load multiple onload events in the body tag?
Michael Landberg wrote on 22 jun 2007 in comp.lang.javascript:
onload events are not "loaded" themselves.
<body onload='action1();action2();'>
You could also just attach a function to onload that calls two or more
actions:
<body onload="onLoadFunction();">
function onLoadFunction() {
actionOne();
actionTwo();
.
.
.
actionOneHundred();
}
Keeps more JS out of the HTML which is cleaner.
You should also think
about attaching the events from inside the JS. You can use the code
here:
http://therealcrisp.xs4all.nl/upload/addEvent_dean.html
A better way would be to attach an event to the body, and then simply
call one function:
function onLoadFunction () {
actionOne();
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.