From bb998f25185e9b98514219e2ab169411f4ed7fb0 Mon Sep 17 00:00:00 2001 From: Brandon Aaron Date: Sat, 6 Oct 2007 16:45:20 +0000 Subject: [PATCH] Fix regression in add and append in IE after revision 3463 --- src/core.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/core.js b/src/core.js index 0cf0444c3..59cc1fc97 100644 --- a/src/core.js +++ b/src/core.js @@ -331,7 +331,12 @@ jQuery.fn = jQuery.prototype = { }, add: function( selector ) { - return this.pushStack( jQuery.merge( this.get(), jQuery( selector ) ) ); + return this.pushStack( jQuery.merge( + this.get(), + selector.constructor == String ? + jQuery( selector ).get() : + selector.length != undefined && (!selector.nodeName || jQuery.nodeName(selector, "form")) ? + selector : [selector] ) ); }, is: function( selector ) { @@ -948,18 +953,18 @@ jQuery.extend({ div.firstChild && div.firstChild.childNodes : // String was a bare or - wrap[1] == "" && s.indexOf("" && tags.indexOf("= 0 ; --i ) if ( jQuery.nodeName( tbody[ i ], "tbody" ) && !tbody[ i ].childNodes.length ) tbody[ i ].parentNode.removeChild( tbody[ i ] ); - + // IE completely kills leading whitespace when innerHTML is used if ( /^\s/.test( elem ) ) div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild ); - + } elem = jQuery.makeArray( div.childNodes ); -- 2.39.5