Fix #11309. Recognize hexadecimal in data attributes.

This commit is contained in:
Sindre Sorhus
2012-02-09 20:25:43 -05:00
committed by Dave Methvin
parent 974e4afbe2
commit 96bb57d4ef
2 changed files with 4 additions and 2 deletions

View File

@@ -333,7 +333,7 @@ function dataAttr( elem, key, data ) {
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
jQuery.isNumeric( data ) ? parseFloat( data ) :
jQuery.isNumeric( data ) ? +data :
rbrace.test( data ) ? jQuery.parseJSON( data ) :
data;
} catch( e ) {}