[thelist] [javascript] Window.onload > YUI vs. Prototype

Paul Bennett Paul.Bennett at wcc.govt.nz
Mon Apr 7 15:36:59 CDT 2008

> mechanism to assist in adding something to window.onload without
> wiping out anything already on that event.

Hi Matt,

Thanks for the response. I'm currently using addListener and have tried it inside and outside (after) the 2nd window.onload call. The method returns true (implying that the listener attached successfully) but lightbox doesn't work.

Here's the basic logic

Load lightbox files
        lightbox initialized by initLightbox();
        global var set for common.js to check for
Load common.js
        window.onload called again and addListener used to attach methods to various events / elements
        addListener used to reload lightbox when var is set:
        // load lightbox again if the file has been loaded
        if(typeof lbLoaded == 'number'){
                YAHOO.util.Event.addListener(document.body, 'load', initLightbox);

More information about the thelist mailing list