]> source.dussan.org Git - jquery.git/commitdiff
Make sure that document.body exists, at least, in IE before the ready event is fired...
authorJohn Resig <jeresig@gmail.com>
Sat, 7 Nov 2009 15:00:43 +0000 (16:00 +0100)
committerJohn Resig <jeresig@gmail.com>
Sat, 7 Nov 2009 15:00:43 +0000 (16:00 +0100)
src/event.js

index aabe77eadcb3305c6d4450fc94bfb91edee9f36d..f9c5fae014b90420ad24a971438e541880efa8bd 100644 (file)
@@ -822,7 +822,8 @@ function bindReady() {
                // ensure firing before onload,
                // maybe late but safe also for iframes
                document.attachEvent("onreadystatechange", function() {
-                       if ( document.readyState === "complete" ) {
+                       // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+                       if ( document.readyState === "complete" && document.body ) {
                                document.detachEvent( "onreadystatechange", arguments.callee );
                                jQuery.ready();
                        }