New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$.data is not consistent with $("selector").data in jQuery 2.0 #2779

Closed
cbonnissent opened this Issue Dec 16, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@cbonnissent

cbonnissent commented Dec 16, 2015

When store something with

$.data(element, "key-with-hypen", true);

you cannot get it, with the

$(element).data("keyWithHyphen", true);

The behaviour is new in the version 2.0, while version 1.11.3 get the stored data correctly

=> test case in version 1.11.3

http://jsbin.com/rulejupufu/1/edit?html,js,output

=> test case in version 2.1.4

http://jsbin.com/jawupunedu/1/edit?html,js,output

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Dec 16, 2015

Member

Thanks for the report. This will be fixed in jQuery 3.0: http://jsbin.com/gehotepamo/1/edit?html,js,output. We planned to fix that there on both branches but we'll have only one jQuery 3.0.0 after all.

I'm not sure what to do about it in the upcoming jQueries 1.12/2.2. This inconsistency is unfortunate as we declare API compatibility between 1.x & 2.x. Thoughts, @jquery/core? Do we want to patch it?

Member

mgol commented Dec 16, 2015

Thanks for the report. This will be fixed in jQuery 3.0: http://jsbin.com/gehotepamo/1/edit?html,js,output. We planned to fix that there on both branches but we'll have only one jQuery 3.0.0 after all.

I'm not sure what to do about it in the upcoming jQueries 1.12/2.2. This inconsistency is unfortunate as we declare API compatibility between 1.x & 2.x. Thoughts, @jquery/core? Do we want to patch it?

@mgol mgol added the Needs review label Dec 16, 2015

@timmywil

This comment has been minimized.

Show comment
Hide comment
@timmywil

timmywil Dec 17, 2015

Member

Yea, I guess the branches should be consistent.

Member

timmywil commented Dec 17, 2015

Yea, I guess the branches should be consistent.

@markelog markelog added 1.x-only 2.x-only and removed 1.x-only labels Dec 21, 2015

@mgol mgol removed the Needs review label Dec 21, 2015

@mgol mgol added this to the 1.12/2.2 milestone Dec 21, 2015

@timmywil

This comment has been minimized.

Show comment
Hide comment
@timmywil

timmywil Jan 7, 2016

Member

Fixed in 2.2

Member

timmywil commented Jan 7, 2016

Fixed in 2.2

@timmywil timmywil closed this Jan 7, 2016

@cbonnissent

This comment has been minimized.

Show comment
Hide comment
@cbonnissent

cbonnissent Jan 8, 2016

Thank you !

cbonnissent commented Jan 8, 2016

Thank you !

@cssmagic cssmagic referenced this issue May 18, 2016

Open

jQuery #5

@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.