document.onreadystatechange = subSomething;function subSomething() { if(document.readyState == "complete") { alert("加载完成") }}