Welcome to WebmasterWorld Guest from 54.147.44.93

Forum Moderators: open

Message Too Old, No Replies

onLoad Events

is this possible

     

stcrim

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

WebmasterWorld Senior Member 10+ Year Member



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?

-s-

jatar_k

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

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



yes it is, I have one like so

onLoad="javascript:breakFrame();opensweepswindow();"

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. ;)

stcrim

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

WebmasterWorld Senior Member 10+ Year Member



jatar_k

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?

-s-

jatar_k

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

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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.

claus

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

WebmasterWorld Senior Member 10+ Year Member



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

[directory.google.com...]

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.

/claus

MonkeeSage

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

WebmasterWorld Senior Member 10+ Year Member



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.

Jordan

Purple Martin

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

WebmasterWorld Senior Member 10+ Year Member



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

MonkeeSage

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

WebmasterWorld Senior Member 10+ Year Member



Purple_Martin:

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. :)

Jordan

 

Featured Threads

Hot Threads This Week

Hot Threads This Month