[thelist] window.onload = window.onload + ....

Toby Mills toby at tobymills.com
Wed Feb 18 10:50:46 CST 2004


oldLoad = window.onload
window.onload = function(){newOnload();if(oldLoad){oldLoad();}}
or 
window.onload = function(){if(oldLoad){oldLoad();}newOnload();}
depending on what order you want your onload function to run

-------------------------------
toby mills
web developer & programmer


www.tobymills.com

 


-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Scott Blanchard
Sent: 18 February 2004 16:47
To: thelist at lists.evolt.org
Subject: [thelist] window.onload = window.onload + ....

When executing a window.onload handler in a .js file, how can I insure that 
my onload handler does not prevent any other onload handlers from firing??

For example, my onload handler is in a javascript include which must be 
present in a CMS template file for the template to function. However, the 
template designer may have an onload handler in the body tag, for example, 
or in a script include external to mine. Is there a collection of onload 
handlers that can be appended to?

_________________________________________________________________
Get fast, reliable access with MSN 9 Dial-up. Click here for Special Offer! 
http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/

-- 
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 




More information about the thelist mailing list