Side navigation
#8140 closed bug (duplicate)
Opened February 02, 2011 12:24PM UTC
Closed February 05, 2011 02:54PM UTC
Last modified May 15, 2012 11:41PM UTC
[ IE8 ] Cache[ id ] undefined in jQuery.data in jquery-1.5.js
Reported by: | mkluczka@gmail.com | Owned by: | mkluczka@gmail.com |
---|---|---|---|
Priority: | blocker | Milestone: | 1.5.1 |
Component: | event | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I'm getting error ''"undefined" is empty or not an object'',
in Internet Explorer 8, in jQuery.data function on line 1348 in file jquery-1.5.js
if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
I found that, cache[ id ] is in my case undefined, and the case is not in condition.
My fix for it:
if(id !== undefined && cache[ id ] === undefined) cache[ id ] = [];
in line before the condition
Attachments (0)
Change History (12)
Changed February 02, 2011 12:31PM UTC by comment:1
component: | unfiled → data |
---|---|
owner: | → mkluczka@gmail.com |
status: | new → pending |
Changed February 02, 2011 02:40PM UTC by comment:2
status: | pending → new |
---|
The error had place in our internal application, so it's not realy possible to full reproduce it somewhere else.
One thing I can do, is to give backtrace:
1. $('#element').change || $('#element').click
2. Line 2127 inside jQuery.event.add method var elemData = jQuery._data( elem );
3. Line 1483 inside jQuery._data method return jQuery.data( elem, name, data, true );
4. Line 1348 inside jQuery.data method if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
Changed February 04, 2011 11:55PM UTC by comment:3
I've got the same problem. After debugging one hour through the jQuery code I still have no clue. And I can not provide you a small and clean sample. But I think you guys are much more savvy than me.
A (not so small) sample is here http://www.akottr.de/dragtable/index-jq15.html.
The page http://www.akottr.de/dragtable/index.html works fine. This page uses jQuery 1.5, too. But on this page the dragtable is a Plugin not a Widget. Maybe this bug only occurs when using the ui widget api.
Changing line 1453
delete cache[ id ];
to
cache[ id ] = {};
works fine for me. But I don't think that's a nice solution.
Changed February 05, 2011 02:05AM UTC by comment:4
status: | new → pending |
---|
Replying to [comment:3 akottr]:
I've got the same problem. After debugging one hour through the jQuery code I still have no clue. And I can not provide you a small and clean sample. But I think you guys are much more savvy than me. A (not so small) sample is here http://www.akottr.de/dragtable/index-jq15.html.
Could you (temporarily) use http://code.jquery.com/jquery-git.js (instead of 1.5) on that page and then check again if the error still occurs. There is a known regression in 1.5 which affects jQuery UI (currently it's not advised/supported to use jQuery UI 1.8.x with jQuery 1.5)
Changed February 05, 2011 12:21PM UTC by comment:5
Works fine. Thanks.
Changed February 05, 2011 02:54PM UTC by comment:6
component: | data → event |
---|---|
milestone: | 1.next → 1.5.1 |
priority: | undecided → blocker |
resolution: | → duplicate |
status: | pending → closed |
Changed June 28, 2011 09:38AM UTC by comment:8
I am so glad I found this... I'm using jQuery version 1.6.1 and the problem user mkluczka reported persists. Although, his proposed fix does the job.
Same case, the error is happening inside an internal app module (file manager) so jsfiddle is not an option for feedback. There seems to be a problem when clicking an element when it's already clicked/selected once.
This is the .click() call:
$('.myTree li span').click(function(e) { ... a lot of If-Else code ... ... e.ctrlKey, e.shiftKey used also, if it helps ... })
Please see into this once more. Thnx for the fantastic effort so far.
Changed August 04, 2011 01:27PM UTC by comment:9
To add my two cents. I see this issue in 1.6.2 as well and the fix initially provided in the bug report stops the unhandled exception. However .data still loses data in IE8
Changed April 28, 2012 12:02AM UTC by comment:10
This is still a problem for me in jQuery 1.7.2 using IE8. Here's an example in jsFiddle: http://jsfiddle.net/HwGfk/4/
Changed April 28, 2012 05:11AM UTC by comment:11
@mike.m.lin, print out the id value: http://jsfiddle.net/HwGfk/5/
The rest is an exercise left to the reader, but it is not a jQuery bug.
Changed May 15, 2012 11:41PM UTC by comment:12
@dmethvin, I see _my_ problem. Thanks for the response ;)
Replying to [comment:11 dmethvin]:
@mike.m.lin, print out the id value: http://jsfiddle.net/HwGfk/5/ The rest is an exercise left to the reader, but it is not a jQuery bug.
Thanks for taking the time to contribute to the jQuery project by writing a bug report.
Please submit a reduced test case, which reproduces the issue you are experiencing, on http://jsfiddle.net. So that we can investigate this issue further.
How to report bugs