From 4a99fcf6e4b152706b951df584614da32b08f6e4 Mon Sep 17 00:00:00 2001 From: Brandon Aaron Date: Sat, 16 May 2009 19:32:16 +0000 Subject: [PATCH] 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. --- src/manipulation.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 -- 1.7.10.4