Switch to using isNaN instead of RegExp for data-.
This commit is contained in:
parent
e0b24306a8
commit
8ebb9b22df
1 changed files with 1 additions and 2 deletions
|
@ -1,7 +1,6 @@
|
||||||
(function( jQuery ) {
|
(function( jQuery ) {
|
||||||
|
|
||||||
var windowData = {},
|
var windowData = {},
|
||||||
rnum = /^-?\d+(?:\.\d+)?(?:E\d+)?$/,
|
|
||||||
rbrace = /^(?:{.*}|\[.*\])$/;
|
rbrace = /^(?:{.*}|\[.*\])$/;
|
||||||
|
|
||||||
jQuery.extend({
|
jQuery.extend({
|
||||||
|
@ -158,7 +157,7 @@ jQuery.fn.extend({
|
||||||
data = data === "true" ? true :
|
data = data === "true" ? true :
|
||||||
data === "false" ? false :
|
data === "false" ? false :
|
||||||
data === "null" ? null :
|
data === "null" ? null :
|
||||||
rnum.test( data ) ? parseFloat( data ) :
|
!isNaN( data ) ? parseFloat( data ) :
|
||||||
rbrace.test( data ) ? jQuery.parseJSON( data ) :
|
rbrace.test( data ) ? jQuery.parseJSON( data ) :
|
||||||
data;
|
data;
|
||||||
} catch( e ) {}
|
} catch( e ) {}
|
||||||
|
|
Loading…
Add table
Reference in a new issue