#11178 closed bug (duplicate)
data- attribute with 18 digit or larger number
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Every digit after the 17th comes back as a zero instead of its proper value.
I am not familiar with all the uses of isNumeric so I suggest only checking values for dataAttr function
line 1996: jQuery.isNumeric( data ) && data.length < ( data.indexOf('.') != -1 ? 18 : 17 ) ? parseFloat( data ) :
Otherwise, we could just not try to convert to a number.
Note: See
TracTickets for help on using
tickets.
jQuery.fn.data()
converts all string values into real JavaScript primitive and object values (string, number, boolean, object, array etc). Given this information and knowing that the largest finite integral number in JavaScript is 253, or 9007199254740992 (try adding 1 to that number, it won't work), which is 16 characters long, we can assume that numbers of that length will not be valid in JavaScript. If you need the full value, access withjQuery.fn.attr()