Skip to content

Commit

Permalink
Set background to none on our mock body and remove its contents to av…
Browse files Browse the repository at this point in the history
…oid a crash in IE when removing it. Fixes #9028.
  • Loading branch information
timmywil committed May 2, 2011
1 parent 24a8ffb commit f1392d8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ jQuery.support = (function() {
width: 0,
height: 0,
border: 0,
margin: 0
margin: 0,
// Set background to avoid IE crashes when removing (#9028)
background: "none"
};
for ( i in bodyStyle ) {
body.style[ i ] = bodyStyle[ i ];
Expand Down Expand Up @@ -207,6 +209,7 @@ jQuery.support = (function() {
}

// Remove the body element we added
body.innerHTML = "";
document.documentElement.removeChild( body );

// Technique from Juriy Zaytsev
Expand Down

0 comments on commit f1392d8

Please sign in to comment.