From f1392d82089323ec9ef97b33909b960cc16c25b6 Mon Sep 17 00:00:00 2001 From: timmywil Date: Mon, 2 May 2011 11:57:01 -0400 Subject: [PATCH] Set background to none on our mock body and remove its contents to avoid a crash in IE when removing it. Fixes #9028. --- src/support.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/support.js b/src/support.js index ea14bac6..41af0632 100644 --- a/src/support.js +++ b/src/support.js @@ -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