Skip to main content

Bug Tracker

Side navigation

#8709 closed bug (duplicate)

Opened March 30, 2011 02:05AM UTC

Closed March 30, 2011 04:07AM UTC

Last modified March 14, 2012 03:57PM UTC

.data() converting string to number

Reported by: awensley@gmail.com Owned by:
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.5.1
Keywords: Cc:
Blocked by: Blocking:
Description

I found a strange one. Grabbing a data attribute of an element with a certain value causes jQuery to convert the value to a number in scientific notation.

Example:

<script>$("#test").click(function(){alert($(this).data("code") + "\\n" + $(this).attr("data-code"));});</script>
<a href="#" data-code="2309E34" id="test">Test</a>

The result is:

"2.309e+37

2309E34"

I have tested this is in Firefox V4, Chrome 10, and IE9 with the same result.

Attachments (0)
Change History (3)

Changed March 30, 2011 02:09AM UTC by awensley@gmail.com comment:1

Sorry, I didn't see the notice about jsFiddle before. Here is a link to the test case I entered:

http://jsfiddle.net/tZhXD/

Changed March 30, 2011 04:07AM UTC by ajpiano comment:2

resolution: → duplicate
status: newclosed

Changed March 30, 2011 04:07AM UTC by ajpiano comment:3

Duplicate of #7579.