htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: On Page Load
PostPosted: 01 Nov 2006 10:29 
Offline
User avatar

Joined: 25 Sep 2006 04:48
Posts: 242
Loads the javascript function (fn) AFTER the page loads.

Code:
//------------------------------------
// addLoadListener
function addLoadListener(fn){
    if(typeof window.addEventListener !='undefined')    window.addEventListener('load',fn,false);
    else if(typeof document.addEventListener !='undefined')    document.addEventListener('load',fn,false);
    else if(typeof window.attachEvent !='undefined')    window.attachEvent('onload',fn);
    else{
        var oldfn=window.onload
        if(typeof window.onload !='function')    window.onload=fn;
        else    window.onload=function(){oldfn();fn();}
    }
}
// addLoadListener
//====================


Top
 Profile  
 
 Post subject:
PostPosted: 05 Jan 2007 03:54 
Offline
User avatar

Joined: 25 Sep 2006 04:48
Posts: 242
You can use it like this...

Code:
addLoadListener(init_cookies);
addLoadListener(init_dd);
addLoadListener(init_preload);
addLoadListener(init_formSend);
addLoadListener(init_flash);
addLoadListener(init_previewVideos);
addLoadListener(init_postload);
addLoadListener(init_getNews);




/*-----------------------------------------------------[ START INIT FUNCTIONS ]
*/


//------------------------------------
// init_preload
function init_preload(){
    REFF=document.referrer;
    pageTitle=document.title.substring((document.title.indexOf("»")+2),((document.title.indexOf("|")-1)));
    land=window.location.href;
    pagePath=window.location.pathname;
    _uacct = "UA-879836-1";
    urchinTracker();
    //gi('SW').innerHTML='<pre>'+pageTitle+'<br />'+land+'<br />'+pagePath+'</pre>';
}
// init_preload
//====================



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB