【发布时间】:2012-11-22 07:11:38
【问题描述】:
在 jQuery 就绪事件逻辑中:
// Catch cases where $(document).ready() is called after the
// browser event has already occurred.
if ( document.readyState === "complete" ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
return setTimeout( jQuery.ready, 1 );
}
您能否解释一下评论:“异步处理以允许脚本有机会延迟准备好”。
我不明白什么脚本以及为什么要延迟准备好?
【问题讨论】:
-
我多次问过自己同样的问题。
-
我也很感兴趣
-
看来这和IE有关我们来到这里是因为oldIE中的readyState === "complete" 足以让我们调用dom ready! @ 987654321@
-
@undefined,找到答案了。