From: John Resig Date: Fri, 19 Dec 2008 06:58:18 +0000 (+0000) Subject: Fixed an issue with domManip where the incorrect clone fragments were being used... X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;h=18ee5a93a2d940789d57544da5f61324bd55e3ec;hp=80a6a91347bcda3ce2f19bf0dfb6973bc97c8916;p=jquery.git Fixed an issue with domManip where the incorrect clone fragments were being used for elements. --- diff --git a/src/core.js b/src/core.js index 685ca2b..18069bc 100644 --- a/src/core.js +++ b/src/core.js @@ -501,11 +501,12 @@ jQuery.fn = jQuery.prototype = { if ( this[0] ) { var fragment = document.createDocumentFragment(), scripts = jQuery.clean( args, this[0].ownerDocument, fragment ), - first = fragment.firstChild; + first = fragment.firstChild, + extra = this.length > 1 ? fragment.cloneNode(true) : fragment; if ( first ) for ( var i = 0, l = this.length; i < l; i++ ) - callback.call( root(this[i], first), this.length > 1 ? fragment.cloneNode(true) : fragment ); + callback.call( root(this[i], first), i > 0 ? extra.cloneNode(true) : fragment ); if ( scripts ) jQuery.each( scripts, evalScript );