Skip to content

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

@cbonnissent

Description

@cbonnissent

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions