Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
window仅readystatechange在 IE 和 Edge 中触发事件(在 IE 11 中测试)。它不会在 Firefox 或 Chrome 中触发。
window
readystatechange
它实际上是由文档触发的,当它readyState更改为"interactive"和"complete"(冒泡)时。
readyState
"interactive"
"complete"
因此,在 IE 中:
window.onreadystatechange == document.onreadystatechange
我不建议使用它,因为此事件不会在其他浏览器中触发。