From c1ac9fdf45632f0e0d1f7183500ce45dde7319d7 Mon Sep 17 00:00:00 2001 From: jeresig Date: Sat, 13 Feb 2010 03:30:45 -0500 Subject: [PATCH] Don't inject style elements using innerHTML as they will go away in IE. Fixes #5977. --- src/manipulation.js | 2 +- test/unit/manipulation.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/manipulation.js b/src/manipulation.js index a10feae..a58e52b 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -5,7 +5,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, rtagName = /<([\w:]+)/, rtbody = /").html(valueObj(" "))[0].innerHTML, " ", "Make sure entities are passed through correctly." ); equals( jQuery("
").html(valueObj("&"))[0].innerHTML, "&", "Make sure entities are passed through correctly." ); + jQuery("#main").html(valueObj("")); + + equals( jQuery("#main").children().length, 1, "Make sure there is a child element." ); + equals( jQuery("#main").children()[0].nodeName.toUpperCase(), "STYLE", "And that a style element was inserted." ); + reset(); // using contents will get comments regular, text, and comment nodes var j = jQuery("#nonnodes").contents(); -- 1.7.10.4