Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

document.onreadystatechange

概述

readystatechange事件会在document.readyState属性发生变化时触发.

语法

document.onreadystatechange = funcRef;

funcRef 是个函数引用,会在readystatechange事件触发时调用.

例子

// 模拟DOMContentLoaded事件
document.onreadystatechange = function () {
    if (document.readyState == "complete") {
        initApplication();
    }
}

相关链接

规范

文档标签和贡献者

 此页面的贡献者: ziyunfei, teoli, khalid32
 最后编辑者: khalid32,