Discussion Locked

Multiple OnLoad java scripts

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Is it possible to have more than one Onload spripts in an html page? If so what is the correct way of doing this. I want to be able to run to animations, one after the other.
Thanks

3 replies

by jay eckles

There should only be one onLoad event handler in a page. However, there's no reason you can't call multiple functions from that one onLoad event. Perhaps a better idea is to create an onLoad event handler function...then in the onLoad event, you call your handler function, and that function calls others, and if needed, coordinates and times the calls to other functions.

or

function loadpage(){
function1() ;
function2() ;
return true ;
}

If you're mixing VBScript and Javascript (for instance in an all-IE corporate intranet), then you can call VBScript functions from Javascript, so the above solution will work.

Good luck.

Jay Eckles
www.jayeckles.com

This discussion is closed to new replies.