Bug Tracker

Opened 13 years ago

Closed 13 years ago

#6073 closed bug (wontfix)

$.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 (http://code.google.com/p/slimbox/source/browse/trunk/js/slimbox2.js#140) 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.


Change History (1)

comment:1 Changed 13 years ago by john

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.

Note: See TracTickets for help on using tickets.