Skip to main content

Bug Tracker

Side navigation

#11190 closed bug (invalid)

Opened January 18, 2012 06:52PM UTC

Closed February 02, 2012 08:17AM UTC

$(exp).data() yields syntax error - unrecognized expression

Reported by: jasonburke@programmer.net Owned by: jasonburke@programmer.net
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

I'm trying to use the data() function in assigning data to specific dom elements that is returned as json and I'm receiving the following error in Firebug:

""Syntax error, unrecognized expression: .

data(elem=div#ui-datepicker-div.ui-datepicker✉, name=undefined, data=undefined, pvt=true)OmNzo9...p2TA.js (line 1666)

_data(elem=div#ui-datepicker-div.ui-datepicker✉, name=undefined, data=undefined)OmNzo9...p2TA.js (line 1847)

add(elem=div#ui-datepicker-div.ui-datepicker✉, types="mouseout", handler=function(), data=null, selector=undefined)OmNzo9...p2TA.js (line 2849)

(?)()OmNzo9...p2TA.js (line 3718)

each(object=jQuery(div#ui-datepicker-div.ui-datepicker✉), callback=function(), args=undefined)OmNzo9...p2TA.js (line 658)

each(callback=function(), args=undefined)OmNzo9...p2TA.js (line 271)

on(types="mouseout", selector=undefined, data=null, fn=function(), one=undefined)OmNzo9...p2TA.js (line 3717)

bind(types="mouseout", data=function(), fn=undefined)OmNzo9...p2TA.js (line 3756)

N(a=jQuery(div#ui-datepicker-div.ui-datepicker✉))cozmQY...4XXJ.js (line 488)

M()cozmQY...4XXJ.js (line 487)

M(d=function(), C=undefined)cozmQY...4XXJ.js (line 554)

cozmQY8MS7QySFhOmPMMiatlibNLY61rwdkq7L64XXJ.js()cozmQY...4XXJ.js (line 554)

[Break On This Error]

id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,""

I've traced this down to the following line in jQuery 1.7.1:

Only defining an ID for JS objects if its cache already exists allows

the code to shortcut on the same path as a DOM node with no cache

id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,

isEvents = name === "events";

Attachments (0)
Change History (5)

Changed January 18, 2012 06:55PM UTC by jasonburke@programmer.net comment:1

this is the first ticket I've submitted to jquery and I will come back later to properly fill out this report

Changed January 18, 2012 06:57PM UTC by dmethvin comment:2

owner: → jasonburke@programmer.net
status: newpending

That's fine, just post a test case and we'll take a look.

Changed January 18, 2012 07:01PM UTC by anonymous comment:3

This is the code I was trying to execute:

var assignData = function(data) {

for(var c = 0; c < data.length; c++) {

$('#'+data[c]['rna_well']).data('well', data[c]);

}

}

I believe data is undefined in the scenario when this error occurs. I have this function wrapped inside of a module. Let me know if I can offer any further information.

Changed January 18, 2012 07:02PM UTC by dmethvin comment:4

Please give us a fully working example, preferably on jsFiddle.net. Code snippets can't really be debugged.

Changed February 02, 2012 08:17AM UTC by trac-o-bot comment:5

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!