Make sure that document.body exists, at least, in IE before the ready event is fired. Fixes #5443.

This commit is contained in:
John Resig 2009-11-07 16:00:43 +01:00
parent 513053d62b
commit 81bfd9b870

View 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();
}