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: contact@juliencrouzet.fr Owned by: contact@juliencrouzet.fr
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

(jQuery 1.7.1)

(Bug)

>>> jQuery('#playerContainer')

[object#playerContainer]

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

[object#playerContainer]

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

undefined

(Works on any other tag)

>>> jQuery('#FBEnrjFriendzoneContainer')

[div#FBEnrjFriendzoneContainer]

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

[div#FBEnrjFriendzoneContainer]

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

"bar"

Attachments (0)
Change History (6)

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

owner: → contact@juliencrouzet.fr
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: http://jsfiddle.net/FrKyN/ 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 contact@juliencrouzet.fr comment:3

Sorry, I missed the previous comment.

Here is a jsFiddle test case for that bug : http://jsfiddle.net/jucrouzet/DL4hZ/

Changed March 27, 2012 08:54AM UTC by contact@juliencrouzet.fr comment:4

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

http://jsfiddle.net/jucrouzet/DL4hZ/2/

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

See: http://api.jquery.com/data/

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:

"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

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