From: Elijah Manor Date: Tue, 24 Jul 2012 18:34:14 +0000 (-0400) Subject: Fix #12132. IE10 dislikes detached object elements. Close gh-870. X-Git-Tag: 1.8rc1~25 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=077987876bbd01b8b48a72b3573694fafaa44d39;p=jquery.git Fix #12132. IE10 dislikes detached object elements. Close gh-870. --- diff --git a/src/manipulation.js b/src/manipulation.js index d118529d4..212eaf6bb 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -436,11 +436,12 @@ function cloneFixAttributes( src, dest ) { nodeName = dest.nodeName.toLowerCase(); - // IE6-8 fail to clone children inside object elements that use - // the proprietary classid attribute value (rather than the type - // attribute) to identify the type of content to display if ( nodeName === "object" ) { - dest.outerHTML = src.outerHTML; + // IE6-10 improperly clones children of object elements using classid. + // IE10 throws NoModificationAllowedError if parent is null, #12132. + if ( dest.parentNode ) { + dest.outerHTML = src.outerHTML; + } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient.