Skip to main content

Bug Tracker

Side navigation

#11221 closed bug (invalid)

Opened January 25, 2012 12:40PM UTC

Closed January 26, 2012 10:57PM UTC

Last modified April 17, 2012 06:49PM UTC and not working

Reported by: Owned by:
Priority: low Milestone: None
Component: data Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description and functions running on Firefox 9.0.1 of MacOSX are not returning the correct value. returns the cache element with events, data, handle and parsedAttrs, not only data of cache.

Attachments (0)
Change History (13)

Changed January 25, 2012 02:56PM UTC by addyosmani comment:1

component: unfileddata
owner: →
priority: undecidedlow
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 January 25, 2012 04:27PM UTC by comment:2

status: pendingnew

In jsFiddle seems to be working, but if you run the code snippet on console directly on (which is being used version 1.7.1 of jquery) the error will occur:

var div = $ ('div: first');

$. date (div, 'test', 'test');

console.log ($. date (div));

Any other site with or without jQuery UI occurs that error (just with version 1.7.1 of jquery). So jQuery UI not is the cause of problem.

Note: This error only occurs in Firefox MacOSX (the version used was 9.0.1).

Note 2: This is not an error, just an incorrect result of function.

Changed January 25, 2012 05:31PM UTC by rwaldron comment:3

status: newpending
var div = $ ('div: first'); $. date (div, 'test', 'test'); console.log ($. date (div));

Do you mean $.data()? Why are you using the static $.data method?


  $("div: first").data("test", "test").data()

Changed January 25, 2012 05:33PM UTC by comment:4

status: pendingnew

Same result

Changed January 25, 2012 05:41PM UTC by rwaldron comment:5

status: newpending

Ok, so we ask once again, can you please provide a reduced test case with jsfiddle? Thanks

Changed January 26, 2012 08:40PM UTC by comment:6

status: pendingnew

My test was here

But in jsfiddle do not occurs that error. If you run it directly on firebug the result is diferent.

I copy exactly the html returned by jsfiddle (inserting the firebug lite) and in lite the result was equal to the jsfiddle, but in native firebug the result was diferent (with exactly the same javascript code).


Changed January 26, 2012 09:10PM UTC by rwaldron comment:7

_comment0: Again, I ask.. what is the "ERROR"? The toJSON property? Why are you using the static method?? Use $(div).data()1327612463527305

Again, I ask.. what is the "ERROR"? The toJSON property? Why are you using the static $.data() method?? Use $(div).data()

Changed January 26, 2012 10:57PM UTC by timmywil comment:8

resolution: → invalid
status: newclosed

The test case is invalid. $.data cannot be passed a jQuery object, only an element.

It may help to ask for support on the forums or on the #jquery irc channel.

Changed January 26, 2012 11:16PM UTC by comment:9

You may consider this invalid, but have a bug, only in this version of jquery (any oldest version haven't this bug) and only on this browser (in chrome and safari it work fine).

Both $.data or $ results the same bug. The return on that case are not object with data values, but a top level of this object, containing data, event handlers, etc. It is no a problem to worry about, but this bug exists.

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

I'm having the same issue on FF 10.0.2 and 11.0 on OS X. In jsfiddle everything works, but your own code it fails. Try this in your console:

var $div = $('<div></div>'); $'a','1'); console.log( $'a') );

>> 'undefined'

It's undefined because $ actually returns the the top-level object of data. To get the expected behavior you have to go one-level deep, so both of these work:

var $div = $('<div></div>'); $'a','1'); console.log( $'data.a') );

var $div = $('<div></div>'); $'a','1'); console.log( $ );

Notice that you have to get the 'data' property of the returned object from data().

Changed March 13, 2012 01:05AM UTC by comment:11

Never mind, the problem isn't with jQuery it's with FireQuery 1.1. If you disable that extension, data() works as expected.

Changed March 28, 2012 10:46AM UTC by anonymous comment:12

F.Y.I. I am having the same problem. Using IE9. I have had to rewrite my code to stop using and to attach the data directly to the dom elements instead. Problem was not present in earlier versions of jquery. The problem occurs sporadically which makes it uneasy to reproduce.

Changed April 17, 2012 06:49PM UTC by anonymous comment:13

fixed in FireQuery 1.2, I'm sorry for the troubles