X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=0b27f7428e8ab4e865c5ddfb47fd51e2fd0e4cc2;hb=2db27efd662693dd90fbf89ea1e4bbee7c9fb929;hp=511180a08a58bcedfc58087978f1ae3b1ecb7b00;hpb=9a7652260b7addcf8874bd46926ff92182b500ea;p=jquery.git diff --git a/src/core.js b/src/core.js index 511180a..0b27f74 100644 --- a/src/core.js +++ b/src/core.js @@ -410,9 +410,7 @@ jQuery.fn = jQuery.prototype = { jQuery.inArray(this.name, value) >= 0); else if ( jQuery.nodeName( this, "select" ) ) { - var values = value.constructor == Array ? - value : - [ value ]; + var values = jQuery.makeArray(value); jQuery( "option", this ).each(function(){ this.selected = (jQuery.inArray( this.value, values ) >= 0 || @@ -639,7 +637,9 @@ jQuery.extend({ else script.appendChild( document.createTextNode( data ) ); - head.appendChild( script ); + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); head.removeChild( script ); } }, @@ -774,7 +774,7 @@ jQuery.extend({ ""; }, - // internal only, use is(".class") + // internal only, use hasClass("class") has: function( elem, className ) { return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1; }