Skip to main content

Bug Tracker

Side navigation

#10368 closed bug (invalid)

Opened September 28, 2011 05:13PM UTC

Closed September 28, 2011 06:53PM UTC

IE's .data() returns empty object

Reported by: Owned by: rwaldron
Priority: low Milestone:
Component: data Version: 1.6.4
Keywords: Cc:
Blocked by: Blocking:

It looks like there is a regression in 1.6.4 jQuery. Calling $('div').data() on <div data-elem-ID="HTML"></div> returns an empty object.

Attachments (0)
Change History (5)

Changed September 28, 2011 05:44PM UTC by dmethvin comment:1

owner: →
status: newpending

That's correct, see item 5 here:

If you access the properties via .data() it should still be possible to get them consistently across different versions, only the internal representation has changed so we could be compliant with the way the W3C wants it.

What should we add to the documentation at to clarify the issue? Looks like we don't have an example with a dash, which would probably help.

Changed September 28, 2011 06:18PM UTC by rwaldron comment:2

component: unfileddata
keywords: → needsdocs
priority: undecidedlow

Simply put, you're asking for invalid property identifiers... See:

Changed September 28, 2011 06:26PM UTC by comment:3

status: pendingnew

No, you are missing the point. I discovered a regression while researching a browser inconsistency. It is not a documentation issue.

If you load this in FF and IE, they will give different results (using jQuery 1.6.3). This is what I was researching.

But, while doing that research, I found IE doesn't give _any_ data (using jQuery edge). This is the bug I am reporting.

Changed September 28, 2011 06:49PM UTC by rwaldron comment:4

keywords: needsdocs
owner: psayre@sitecrafting.comrwaldron
status: newassigned

Changed September 28, 2011 06:53PM UTC by rwaldron comment:5

resolution: → invalid
status: assignedclosed

"data-elem-ID" is an _invalid_ attribute. See:

A custom data attribute is an attribute in no namespace whose name starts with the string "data-", has at least one character after the hyphen, is XML-compatible, and contains no characters in the range U+0041 to U+005A (LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z).

Correct: (works in all IEs)