X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fdata.js;h=dda1683a52fc2b5d7f0ebb00e38da062c5ccdaab;hb=ae9df1412c41b1ae676d3808c323b0f01e0b0600;hp=cc027158c8c613356a706f151c507b8696f4eb17;hpb=d5d4e4df65b56319b4f1216f63008a9751690315;p=jquery.git diff --git a/src/data.js b/src/data.js index cc02715..dda1683 100644 --- a/src/data.js +++ b/src/data.js @@ -152,12 +152,15 @@ jQuery.fn.extend({ if ( data === undefined && this[0].nodeType === 1 ) { data = this[0].getAttribute( "data-" + key ); - if ( data != null ) { + if ( typeof data === "string" ) { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : rnum.test( data ) ? parseFloat( data ) : data; + + } else { + data = undefined; } } }