]> source.dussan.org Git - jquery.git/commitdiff
Delay the result of the readyState check to give scripts the opportunity to delay...
authorjeresig <jeresig@gmail.com>
Thu, 23 Sep 2010 15:38:22 +0000 (11:38 -0400)
committerjeresig <jeresig@gmail.com>
Thu, 23 Sep 2010 15:38:22 +0000 (11:38 -0400)
src/core.js

index b747e5beaa669e57018767d7c65067f99e686ed6..f6a07eb8baef66002f3cc8bb2b63d3e2ed434796 100644 (file)
@@ -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