文档加载完后执行相关事件 document.onreadystatechange = function () { if(document.readyState == 'complete'){ // code } }