Skip to main content

Bug Tracker

Side navigation

#6073 closed bug (wontfix)

Opened February 11, 2010 02:15PM UTC

Closed February 11, 2010 06:00PM UTC

$.data doesn't work on object's

Reported by: greut Owned by:
Priority: Milestone: 1.4.2
Component: data Version: 1.4.1
Keywords: Cc:
Blocked by: Blocking:

Slimbox ( relies on $.data to store the old display state of an object tag. But this one doesn't work (I'm using Firefox/3.5.6 on Linux).

Actual result

>>> $.data($("object")[0], "foo", "bar");
>>> $.data($("object")[0], "foo")

Expected result

>>> $.data($("object")[0], "foo", "bar");
>>> $.data($("object")[0], "foo")

If needed, I can contribute to writing some tests even though they shouldn't be hard to do.


Attachments (0)
Change History (1)

Changed February 11, 2010 06:00PM UTC by john comment:1

resolution: → wontfix
status: newclosed

That's correct - we no longer store data on object, applet, or embed elements. When you attach expandos directly to those elements you're interacting directly with the internal plugin (such as Java or Flash). We found that a number of critical problems occurred by allowing this (the plugins couldn't understand why a new property was getting added and would throw an uncatchable exception).

In this specific case you're just attaching a boolean property (it's either 'hidden' or 'visible') so perhaps it would be better to use a class? Then you can just use addClass/hasClass to determine the right course of action.