1 //文档加载完成之后执行 2 (function(){ 3 var _globeCallback; 4 window.$$ = function(callback){ 5 _globeCallback = callback; 6 }; 7 function documentReady(){ 8 _globeCallback(); 9 } 10 //document ready --mobile -webkit 11 var listenerDocumentReady = function(){ 12 console.log(document.readyState); 13 if(document.readyState=='complete'){ 14 documentReady(); 15 clearInterval(_readyInterval); 16 } 17 } 18 var _readyInterval = setInterval(listenerDocumentReady,10); 19 })();