X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmanipulation.js;h=13983fb016ef700f0e43e8b9b4e3f58a89c0b2fb;hb=28ab4d32247943e1ae3409b23fe69303df0bc9eb;hp=ce9b917916b83b276f898c37b6e6f151d7604290;hpb=9476530fa1e39ce1324e98f4dbb79576895372e5;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index ce9b917..13983fb 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -146,13 +146,13 @@ jQuery.fn.extend({ for ( var i = 0, l = this.length; i < l; i++ ) callback.call( root(this[i], first), this.length > 1 || i > 0 ? fragment.cloneNode(true) : fragment ); - + if ( scripts ) jQuery.each( scripts, evalScript ); } return this; - + function root( elem, cur ) { return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ? (elem.getElementsByTagName("tbody")[0] || @@ -186,8 +186,7 @@ jQuery.each({ remove: function( selector ) { if ( !selector || jQuery.multiFilter( selector, [ this ] ).length ) { if ( this.nodeType === 1 ) { - cleanData( this.getElementsByTagName("*") ); - cleanData( [this] ); + cleanData( jQuery("*", this).add(this) ); } if ( this.parentNode ) { @@ -199,7 +198,7 @@ jQuery.each({ empty: function() { // Remove element nodes and prevent memory leaks if ( this.nodeType === 1 ) { - cleanData( this.getElementsByTagName("*") ); + cleanData( jQuery("*", this) ); } // Remove any remaining nodes @@ -306,7 +305,7 @@ jQuery.extend({ // IE completely kills leading whitespace when innerHTML is used if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) ) div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild ); - + elem = jQuery.makeArray( div.childNodes ); } @@ -327,7 +326,7 @@ jQuery.extend({ fragment.appendChild( ret[i] ); } } - + return scripts; }