标签:
//dom ready执行 function ready(fn){ if(document.addEventListener){ document.addEventListener(‘DOMContentLoaded‘,function(){ document.removeEventListener(‘DOMContentLoaded‘,arguments.callee); fn(); }); }else if(document.attachEvent){ document.attachEvent(‘onreadystatechange‘,function(){ if(document.readystate==‘complete‘){ document.dispatchEvent(‘onreadystatechange‘,arguments.callee); fn(); } }) } }
标签:
原文地址:http://www.cnblogs.com/zfdai/p/5539324.html