]> source.dussan.org Git - jquery.git/commitdiff
Require that, at least, document.body exists before firing the ready event. This...
authorJohn Resig <jeresig@gmail.com>
Mon, 9 Nov 2009 12:47:53 +0000 (13:47 +0100)
committerJohn Resig <jeresig@gmail.com>
Mon, 9 Nov 2009 12:47:53 +0000 (13:47 +0100)
src/event.js

index 1b4c539b9d1f6df5948493a3da1fcd104ce5d39d..7cfb535b6f1d8a5242303bc78ec8f97001be9eeb 100644 (file)
@@ -791,6 +791,10 @@ jQuery.extend({
        ready: function() {
                // Make sure that the DOM is not already loaded
                if ( !jQuery.isReady ) {
+                       if ( !document.body ) {
+                               return setTimeout( jQuery.ready, 13 );
+                       }
+
                        // Remember that the DOM is ready
                        jQuery.isReady = true;