Bug Tracker

Modify

Ticket #9688 (closed bug: duplicate)

Opened 23 months ago

Last modified 23 months ago

`data` and `attr` inconsistencies with numbers

Reported by: bentruyman Owned by:
Priority: high Milestone: 1.next
Component: data Version: 1.6.1
Keywords: Cc:
Blocking: Blocked by:

Description

It looks like the data method, when reading data attributes off of nodes, is doing some sort of type conversion on numbers.

See here:  http://jsfiddle.net/MZ49R/

In this example, the attribute data-foo is set to "0001". When accessed via the data method, the number 1 is returned. When accessed via the attr method the string "0001" is returned.

My expectation is that data should return the same value as attr would.

Change History

comment:1 Changed 23 months ago by rwaldron

  • Priority changed from undecided to high
  • Resolution set to duplicate
  • Status changed from new to closed
  • Component changed from unfiled to data

comment:2 Changed 23 months ago by rwaldron

Duplicate of #7579.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.