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 1b4c539..7cfb535 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;