From: jeresig Date: Thu, 23 Sep 2010 15:38:22 +0000 (-0400) Subject: Delay the result of the readyState check to give scripts the opportunity to delay... X-Git-Tag: 1.4.3rc1~69^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e270d804b4cee58dbf438251e9becb6f0f2ac123;p=jquery.git Delay the result of the readyState check to give scripts the opportunity to delay ready, as described by @jrburke in 747ba7defd82bffa6c7ccb69e53b834cbfddb62c. --- diff --git a/src/core.js b/src/core.js index b747e5bea..f6a07eb8b 100644 --- a/src/core.js +++ b/src/core.js @@ -429,7 +429,8 @@ jQuery.extend({ // Catch cases where $(document).ready() is called after the // browser event has already occurred. if ( document.readyState === "complete" ) { - return jQuery.ready(); + // Handle it asynchronously to allow scripts the opportunity to delay ready + return setTimeout( jQuery.ready, 13 ); } // Mozilla, Opera and webkit nightlies currently support this event