X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=0b27f7428e8ab4e865c5ddfb47fd51e2fd0e4cc2;hb=2db27efd662693dd90fbf89ea1e4bbee7c9fb929;hp=27cdbfe1fff23610a704304a660a01a39513cf02;hpb=da76a723e14c037d59e830bb0d01b0b627286020;p=jquery.git diff --git a/src/core.js b/src/core.js index 27cdbfe..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 ); } },