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-Url: http://git.asbjorn.biz/?a=commitdiff_plain;h=e270d804b4cee58dbf438251e9becb6f0f2ac123;hp=2f603359fecca5b4873c45775b293702a2c651e3;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 b747e5b..f6a07eb 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