X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcore.js;h=5e1f0b051b9c5ce1e2ab30279c3ed8d2de2201c4;hb=e87d2c7a5812299ae8390987aec21cc954a8e45a;hp=fdf5072eba6876bc261186bbb8d2b7c11a675972;hpb=ec075266e99e5b3875241341ec1c716fb81b72fc;p=jquery.git diff --git a/src/core.js b/src/core.js index fdf5072..5e1f0b0 100644 --- a/src/core.js +++ b/src/core.js @@ -401,6 +401,9 @@ jQuery.fn = jQuery.prototype = { return undefined; } + if( value.constructor == Number ) + value += ''; + return this.each(function(){ if ( this.nodeType != 1 ) return; @@ -1057,7 +1060,7 @@ jQuery.extend({ elem.parentNode.selectedIndex; // If applicable, access the attribute via the DOM 0 way - if ( notxml && !special && name in elem ) { + if ( name in elem && notxml && !special ) { if ( set ){ // We can't allow the type property to be changed (since it causes problems in IE) if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode ) @@ -1080,11 +1083,13 @@ jQuery.extend({ // convert the value to a string (all browsers do this but IE) see #1070 elem.setAttribute( name, "" + value ); - if ( msie && special && notxml ) - return elem.getAttribute( name, 2 ); - - return elem.getAttribute( name ); + var attr = msie && notxml && special + // Some attributes require a special call on IE + ? elem.getAttribute( name, 2 ) + : elem.getAttribute( name ); + // Non-existent attributes return null, we normalize to undefined + return attr === null ? undefined : attr; } // elem is actually elem.style ... set the style @@ -1239,7 +1244,8 @@ jQuery.extend({ styleFloat: styleFloat, readonly: "readOnly", maxlength: "maxLength", - cellspacing: "cellSpacing" + cellspacing: "cellSpacing", + rowspan: "rowSpan" } });