2008-10-29 25 views

回答

2

我的解決辦法從什麼地方偷,但不記得在哪裏:

//add the load eventListener to the window object 
window.addEventListener("load", function() { functioname.init(); }, true); 


var functionname = { 
    //add the listener for the document load event 
init: function() { 
    var appcontent = document.getElementById("appcontent"); // browser 
    if(appcontent) 
     appcontent.addEventListener("DOMContentLoaded", functionname.onPageLoad, false); 
    }, 
    //function called on document load 
    onPageLoad: function(aEvent) { 
     if(aEvent.originalTarget.nodeName == "#document"){ 
     } 
    } 
}