var domReady = (function (){ var arrDomReadyCallBacks = [] ; function excuteDomReadyCallBacks(){ for (var i=0; i < arrDomReadyCallBacks.length; i++) { arrDomReadyCallBacks[i](); } arrDomReadyCallBacks = [] ; } return function (callback){ arrDomReadyCallBacks.push(callback); if (document.addEventListener ) { document.addEventListener('DOMContentLoaded', excuteDomReadyCallBacks, false); } if (/KHTML|WebKit|iCab/i.test(navigator.userAgent)) { browserTypeSet = true ; var DOMLoadTimer = setInterval(function () { if (/loaded|complete/i.test(document.readyState)) { //callback(); excuteDomReadyCallBacks(); clearInterval(DOMLoadTimer); } }, 10); } window.onload = excuteDomReadyCallBacks;}})()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)