Forum Moderators: open

Message Too Old, No Replies

Onload event for script tag

         

Anusiddhi

2:15 pm on Jul 25, 2008 (gmt 0)

10+ Year Member



I am desperately looking for a 4-5 line sample example for onload function associated with a script tag instead of a body tag

as <script onload="func(parameter)">

Thanks in advance

Fotiman

2:37 pm on Jul 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There is no such thing.

Crispy_Beef

12:21 pm on Jul 26, 2008 (gmt 0)

10+ Year Member



I think this is the kind of thing you are looking for.

[simonwillison.net ]

Basically the function allows you to have as many onload functions as you want. I use it quite a bit in AJAX sites. Loading toolbars and data boxes on the page loading. Works a treat. :)

Fotiman

1:50 pm on Jul 26, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That's fine, but I don't think that's what Anusiddhi is looking for. Anusiddhi was asking about an onload event associated with a script tag, which I took to mean "execute this event handler when the script finishes loading" (not when the page finishes loading).

Anusiddhi

6:07 am on Jul 28, 2008 (gmt 0)

10+ Year Member



Thanks Crispy_Beef