Bug Tracker

Opened 10 years ago

Closed 9 years ago

#14588 closed bug (duplicate)

DOM attributes aren't refetched during el.removeData().data()

Reported by: rbut Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:


When calling .removeData() and subsequently .data() one would expect from the documentation that the result of .data() would contain the current data-* attributes from the DOM.

Instead the result of .data() is an empty dictionary!

I have a JSfiddle showing the issue:


The workaround for now is to call the following on each element after .removeData() and before .data():

jQuery._data(this, "parsedAttrs", false);

It seems the private parsedAttrs data isn't being cleared in removeData().

Thank you.

Change History (2)

comment:1 Changed 10 years ago by rbut

I've updated the fiddle and included the workaround to show the fix:


comment:2 Changed 9 years ago by Timmy Willison

Resolution: duplicate
Status: newclosed

Duplicate of #14587.

Note: See TracTickets for help on using tickets.