From: Brandon Aaron Date: Sat, 16 May 2009 19:32:16 +0000 (+0000) Subject: fix remove and empty to work properly in IE when an element with the id of length... X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;ds=sidebyside;h=4a99fcf6e4b152706b951df584614da32b08f6e4;p=jquery.git fix remove and empty to work properly in IE when an element with the id of length exists. fixes ajax event hanlders in test suite from firing multiple times because they did not get cleaned up. --- diff --git a/src/manipulation.js b/src/manipulation.js index c537c70..13983fb 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -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