概述
readystatechange事件会在document.readyState属性发生变化时触发
.
语法
document.onreadystatechange = funcRef;
funcRef 是个函数引用,会在readystatechange
事件触发时调用.
例子
// 模拟DOMContentLoaded事件 document.onreadystatechange = function () { if (document.readyState == "complete") { initApplication(); } }
相关链接
- document.readyState
- Bug 300992 - onreadystatechange (HTML5/Microsoft extension to DOM document) not supported