Skip to main content

Bug Tracker

Side navigation

#11465 closed bug (invalid)

Opened March 12, 2012 10:11AM UTC

Closed March 27, 2012 08:10AM UTC

Last modified March 27, 2012 02:26PM UTC

$.data() doesn't work on <object>

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

(jQuery 1.7.1)


>>> jQuery('#playerContainer')


>>> jQuery('#playerContainer').data("foo", "bar")


>>> jQuery('#playerContainer').data("foo")


(Works on any other tag)

>>> jQuery('#FBEnrjFriendzoneContainer')


>>> jQuery('#FBEnrjFriendzoneContainer').data("foo", "bar")


>>> jQuery('#FBEnrjFriendzoneContainer').data("foo")


Attachments (0)
Change History (6)

Changed March 12, 2012 10:13AM UTC by sindresorhus comment:1

owner: →
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: Open the link and click to "Fork" (in the top menu) to get started.

Changed March 27, 2012 08:10AM UTC by trac-o-bot comment:2

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Changed March 27, 2012 08:48AM UTC by comment:3

Sorry, I missed the previous comment.

Here is a jsFiddle test case for that bug :

Changed March 27, 2012 08:54AM UTC by comment:4

It seems that previous test was not saved correctly, here is the good test :

Changed March 27, 2012 02:24PM UTC by rwaldron comment:5


Due to the way browsers interact with plugins and external code, the .data() method cannot be used on <object> (unless it's a Flash plugin), <applet> or <embed> elements.

To get around this, your object element requires the classid attribute, having this value:


Changed March 27, 2012 02:26PM UTC by rwaldron comment:6