diff options
author | jeresig <jeresig@gmail.com> | 2010-02-01 18:52:12 -0500 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2010-02-01 18:52:12 -0500 |
commit | f9417b9da980f4fa79d03ba691d9f3442c5ab2f2 (patch) | |
tree | 039c7e5f5abcec8d86d073b6971172beac8d654b /src | |
parent | 1b28bba4d2ba692047813cf5185a7d55e2362472 (diff) | |
download | jquery-f9417b9da980f4fa79d03ba691d9f3442c5ab2f2.tar.gz jquery-f9417b9da980f4fa79d03ba691d9f3442c5ab2f2.zip |
Same problem happens with plain embed elements as well. Follow-up fix to #5904.
Diffstat (limited to 'src')
-rw-r--r-- | src/manipulation.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index 9ef41e075..543bbcd5e 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -5,6 +5,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&\w+;/, + rnocache = /<script|<object|<embed/i, rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, // checked="checked" or checked (html5) fcloseTag = function( all, front, tag ) { return rselfClosing.test( tag ) ? @@ -226,7 +227,7 @@ jQuery.fn.extend({ null; // See if we can take a shortcut and just use innerHTML - } else if ( typeof value === "string" && !/<script|<object/i.test( value ) && + } else if ( typeof value === "string" && !rnocache.test( value ) && (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) && !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) { @@ -389,11 +390,10 @@ function buildFragment( args, nodes, scripts ) { // Only cache "small" (1/2 KB) strings that are associated with the main document // Cloning options loses the selected state, so don't cache them - // IE 6 doesn't like it when you put <object> elements in a fragment + // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document && - args[0].indexOf("<option") < 0 && args[0].indexOf("<object") < 0 && - (jQuery.support.checkClone || !rchecked.test( args[0] )) ) { + !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) { cacheable = true; cacheresults = jQuery.fragments[ args[0] ]; |