Don't inject style elements using innerHTML as they will go away in IE. Fixes #5977.
[jquery.git] / src / manipulation.js
index 1453f98..a58e52b 100644 (file)
@@ -5,7 +5,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
        rtagName = /<([\w:]+)/,
        rtbody = /<tbody/i,
        rhtml = /<|&#?\w+;/,
-       rnocache = /<script|<object|<embed|<option/i,
+       rnocache = /<script|<object|<embed|<option|<style/i,
        rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,  // checked="checked" or checked (html5)
        fcloseTag = function( all, front, tag ) {
                return rselfClosing.test( tag ) ?
@@ -321,7 +321,7 @@ jQuery.fn.extend({
                        parent = value && value.parentNode;
 
                        // If we're in a fragment, just use that instead of building a new one
-                       if ( parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
+                       if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
                                results = { fragment: parent };
 
                        } else {