Make sure that document.body exists, at least, in IE before the ready event is fired. Fixes #5443.
This commit is contained in:
parent
513053d62b
commit
81bfd9b870
1 changed files with 2 additions and 1 deletions
|
@ -822,7 +822,8 @@ function bindReady() {
|
||||||
// ensure firing before onload,
|
// ensure firing before onload,
|
||||||
// maybe late but safe also for iframes
|
// maybe late but safe also for iframes
|
||||||
document.attachEvent("onreadystatechange", function() {
|
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 );
|
document.detachEvent( "onreadystatechange", arguments.callee );
|
||||||
jQuery.ready();
|
jQuery.ready();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue