Modify ↓
Ticket #9688 (closed bug: duplicate)
`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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.
