Set background to none on our mock body and remove its contents to avoid a crash in IE when removing it. Fixes #9028.

1.7/enhancement_8685
timmywil 2011-05-02 11:57:01 -04:00
parent 24a8ffb3ea
commit f1392d8208
1 changed files with 4 additions and 1 deletions

View File

@ -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 ];
@ -207,6 +209,7 @@ jQuery.support = (function() {
}
// Remove the body element we added
body.innerHTML = "";
document.documentElement.removeChild( body );
// Technique from Juriy Zaytsev