aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-02-01 18:22:48 -0500
committerjeresig <jeresig@gmail.com>2010-02-01 18:22:48 -0500
commit1b28bba4d2ba692047813cf5185a7d55e2362472 (patch)
tree918e85c2e651c75841941ae8725068b03cb97e0c /src/manipulation.js
parent31432e048f879b93ffa44c39d6f5989ab2620bd8 (diff)
downloadjquery-1b28bba4d2ba692047813cf5185a7d55e2362472.tar.gz
jquery-1b28bba4d2ba692047813cf5185a7d55e2362472.zip
Make sure that injection of object elements continues to work in IE 6. Really hard to unit test this in a meanigful manner (the result is a visually broken plugin). Will need to be diligent about watching for this in the future. Fixes #5094.
Diffstat (limited to 'src/manipulation.js')
-rw-r--r--src/manipulation.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index 88da6de52..9ef41e075 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -226,7 +226,7 @@ jQuery.fn.extend({
null;
// See if we can take a shortcut and just use innerHTML
- } else if ( typeof value === "string" && !/<script/i.test( value ) &&
+ } else if ( typeof value === "string" && !/<script|<object/i.test( value ) &&
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
@@ -389,9 +389,11 @@ 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
// 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 && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
+ args[0].indexOf("<option") < 0 && args[0].indexOf("<object") < 0 &&
+ (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
cacheable = true;
cacheresults = jQuery.fragments[ args[0] ];