Bug Tracker

Modify

Ticket #7223 (closed bug: fixed)

Opened 4 years ago

Last modified 2 years ago

data( key ) for HTML 5 data-* attributes behaves different from api documentation

Reported by: jitter Owned by:
Priority: undecided Milestone: 1.4.4
Component: unfiled Version: 1.4.3
Keywords: Cc:
Blocking: Blocked by:

Description

The api for data( key ) says

The data- attributes are pulled in the first time the data property is accessed and then are no longer accessed or mutated (all data values are then stored internally in jQuery).

This isn't true. If the data-* attributes are changed after the first call to data( key ) the new value is retrieved.

 test case

Change History

comment:1 Changed 4 years ago by John Resig

  • Status changed from new to closed
  • Resolution set to fixed

Make sure that .data() (no args) returns a list of all the data- properties as well. Also make sure that accessing a data- property via .data() doesn't cause it to change again at a later time (it should be static). Fixes #7222, #7223.

Changeset: 8a5df39045292397a06d08b4fab2ad29819b5d44

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.