1.DOMContentLoaded
DOMContentLoaded是 FF,Opera 9的特有的Event, 當所有DOM解析完以后會觸發(fā)這個事件,。
jquery的ready(示例:$("selector).ready(function(){})) ,MT的onDomReady
IE下是scrollleft事件可以時就表示DomcontentLoaded: var temp = document.createElement('div');temp.doScroll('left');
Fired on a Window object when a document's DOM content is finished loading, but unlike "load", does not wait until all images are loaded. Used for example by GreaseMonkey to sneak in to alter pages before they are displayed.
This event, as many others on this page, is dispatched to "trusted" targets only; for example, it is not dispatched to the content of the main browser object in Firefox, even if it comes from a chrome:/ URI.
2.Onload
onload要等到所有頁面元素加載完成才會觸發(fā), 包括頁面上image,、flash、iframe等內(nèi)容都加載完畢才會執(zhí)行
參考:
1.https://developer.mozilla.org/en/Gecko-Specific_DOM_Events
本文來自CSDN博客,,轉(zhuǎn)載請標明出處:http://blog.csdn.net/beimuaihui/archive/2009/04/27/4130275.aspx
|
|