X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=7ac4ad75b85a7ef4b570dd2dcfd0443f023198ef;hb=feb9051c0e29937c2494c3db0862a671efc21747;hp=6e1ed9e956d6ba2a76f5ceae2d002426269946e4;hpb=4e339ef5573dc6472c00c01a3de883346e6b03a3;p=jquery.git diff --git a/src/core.js b/src/core.js index 6e1ed9e..7ac4ad7 100644 --- a/src/core.js +++ b/src/core.js @@ -418,31 +418,32 @@ jQuery.fn = jQuery.prototype = { } - } else - return this.each(function(){ - if ( this.nodeType != 1 ) - return; + } + + return this.each(function(){ + if ( this.nodeType != 1 ) + return; - if ( value.constructor == Array && /radio|checkbox/.test( this.type ) ) - this.checked = (jQuery.inArray(this.value, value) >= 0 || - jQuery.inArray(this.name, value) >= 0); + if ( value.constructor == Array && /radio|checkbox/.test( this.type ) ) + this.checked = (jQuery.inArray(this.value, value) >= 0 || + jQuery.inArray(this.name, value) >= 0); - else if ( jQuery.nodeName( this, "select" ) ) { - var values = value.constructor == Array ? - value : - [ value ]; + else if ( jQuery.nodeName( this, "select" ) ) { + var values = value.constructor == Array ? + value : + [ value ]; - jQuery( "option", this ).each(function(){ - this.selected = (jQuery.inArray( this.value, values ) >= 0 || - jQuery.inArray( this.text, values ) >= 0); - }); + jQuery( "option", this ).each(function(){ + this.selected = (jQuery.inArray( this.value, values ) >= 0 || + jQuery.inArray( this.text, values ) >= 0); + }); - if ( !values.length ) - this.selectedIndex = -1; + if ( !values.length ) + this.selectedIndex = -1; - } else - this.value = value; - }); + } else + this.value = value; + }); }, html: function( value ) { @@ -971,9 +972,9 @@ jQuery.extend({ div.childNodes : []; - for ( var i = tbody.length - 1; i >= 0 ; --i ) - if ( jQuery.nodeName( tbody[ i ], "tbody" ) && !tbody[ i ].childNodes.length ) - tbody[ i ].parentNode.removeChild( tbody[ i ] ); + for ( var j = tbody.length - 1; j >= 0 ; --j ) + if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) + tbody[ j ].parentNode.removeChild( tbody[ j ] ); // IE completely kills leading whitespace when innerHTML is used if ( /^\s/.test( elem ) )