Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#10012 closed bug (invalid)

$.data(this,'foo') != $(this).data('foo') with html5 data attributes

Reported by: anonymous Owned by:
Priority: low Milestone:
Component: data Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:


$.data(this,'foo') return "undefined" with html5 data attributes $(this).data('foo') return correct value with html5 data attributes

See it: http://jsfiddle.net/4LWvB/

Change History (4)

comment:1 Changed 11 years ago by ajpiano

Resolution: invalid
Status: newclosed

Thanks for taking some time to contribute to the jQuery project, but this is a known, documented, and intended behaviour. From the docs for jQuery.data(elem, key)

"Regarding HTML5 data-* attributes: This low-level method does NOT retrieve the data-* attributes unless the more convenient .data() method has already retrieved them."

comment:2 Changed 11 years ago by Rick Waldron

Component: unfileddata
Milestone: None1.6.3
Priority: undecidedlow

comment:3 Changed 11 years ago by dmethvin

Milestone: 1.6.3

comment:4 Changed 11 years ago by dmethvin

#10111 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.