fix remove and empty to work properly in IE when an element with the id of length...
authorBrandon Aaron <brandon.aaron@gmail.com>
Sat, 16 May 2009 19:32:16 +0000 (19:32 +0000)
committerBrandon Aaron <brandon.aaron@gmail.com>
Sat, 16 May 2009 19:32:16 +0000 (19:32 +0000)
src/manipulation.js

index c537c70..13983fb 100644 (file)
@@ -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