homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

onLoad Events
is this possible

 8:10 pm on Aug 25, 2003 (gmt 0)

Is it possible to have two onLoad events on the same page?

And on a related matter - where does someone who knows nothing about js start to learn?




 8:12 pm on Aug 25, 2003 (gmt 0)

yes it is, I have one like so


I learned js from an o'reilly book called "Dynamic HTML" and pretty much just from doing it.

<added>sorry, I just reread that, you can't have 2 seperate events but you can call multiple functions in the onLoad event.

The one above is even written conditionally through php. ;)


 8:24 pm on Aug 25, 2003 (gmt 0)


Thank you - that was the ticket!

Will check out o'reilly book called "Dynamic HTML - if there are other suggestions for where to learn js - I am ready to give Amazon a small donation...

Any thoughts?



 8:34 pm on Aug 25, 2003 (gmt 0)

That particular book is more of a dictionary where you can look up tags, methods, objects etc. I also have the actual javscript book from o'reilly which is much more in depth.


 8:52 pm on Aug 25, 2003 (gmt 0)

Well, if you are into web-based tutorials and such, there's a nice collection in the G directory:


For books, an author name that pops up is Danny Goodman, he's written a few. There's also the "JavaScript: The Definitive Guide" featuring a rhino on the cover, by David Flanagan.



 1:39 am on Aug 26, 2003 (gmt 0)

Sometimes the onload event doesn't fire in IE (at least on my IE). Another option is to stick a script block right before the closing body tag (</body>) and call your function(s) from there.


Purple Martin

 4:07 am on Aug 26, 2003 (gmt 0)

I've never heard of an onLoad event failing in IE. This makes me wonder if Jordan's page never finishes loading


 4:26 am on Aug 26, 2003 (gmt 0)


LOL, that could very well be. The last time I tested it my markup wasn't exactly up to par (I don't even think I knew about the validator service then). But even so, the stop button still went gray, so I'm not sure that was it.

I might have also been thinking of strapping the handler in the JS itself, like document.body.onload = loaded();, which doesn't seem work in IE at all.

But in any case, I was mistaken about the onload attribute of the body tag, I just tested it a number of times and it has worked every time. :)


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved