Skip to main content

Bug Tracker

Side navigation

#10089 closed bug (invalid)

Opened August 18, 2011 11:52AM UTC

Closed August 18, 2011 02:11PM UTC

.data() and 64 bit integer

Reported by: joakim.hamren@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:
Description

I just fixed a bug where my ID, which is a 64 bit integer, would be truncated to a 32 bit integer. I'm aware of this limitation in javascript, but it's still quite a nasty bug to find. Perhaps some warning or to return it as a string would be safer approach.

E.g:

.data('userid') -> 2820496456973446000

.attr('data-userid') -> "2820496456973446118"

Attachments (0)
Change History (1)

Changed August 18, 2011 02:11PM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

Javascript itself only supports about a 48-bit integer since it's the mantissa of a 64-bit floating point number. That's not something under the control of jQuery. Get the attribute as a string rather than using .data().