#7742 closed bug (duplicate)
float overflow in data attribute
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | 1.6 |
Component: | unfiled | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Incorrect cast in $.fn.data
here is a simple example
var div = document.createElement("div"); div.setAttribute("data-attr","1111111111111111111111111111111") document.body.appendChild(div);
console.log("getAttribute", div.getAttribute("data-attr")); 1111111111111111111111111111111
console.log("jquery.data", $(div).data("attr")); 1.111111111111111e+30
div.parentNode.removeChild(div);
Note: See
TracTickets for help on using
tickets.
Thanks for taking the time to contribute to the jQuery project by writing a bug report.
There is no overflow (1.111111111111111e+30 is valid float) maybe you want to try
But there are known issues with
.data()
related to the html5 data-* attributes. You can follow the ticket noted below for progress