Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 8 years ago

#3947 closed bug (worksforme)

Selectors with "$" symbol

Reported by: simon.crowell Owned by: john
Priority: major Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: asp.net, selector, $ Cc:
Blocked by: Blocking:

Description

I have ran into this problem where I was using the a star rating plugin (this is unrelated).

Essentially a selector in the prevAll method that includes a "$" in it does not work in 1.3 but does in 1.2.6. This is relevant to my application as its an asp.net app that relies on the id of the control which is generally coming out with "$" symbols in it.

I understand there would be a work around for this by removing "$" symbols.

Thanks

Attachments (1)

prevAll bug.zip (36.3 KB) - added by simon.crowell 11 years ago.
Contains Example, Change jQuery version to see different result

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by simon.crowell

Attachment: prevAll bug.zip added

Contains Example, Change jQuery version to see different result

comment:1 Changed 11 years ago by balazs.endresz

http://docs.jquery.com/Selectors

Note: if you wish to use any of the meta-characters described above as a literal part of a name, you must escape the character with two backslashes (\). For example:

#foo\\:bar
#foo\\[bar\\]
#foo\\.bar

comment:2 in reply to:  description Changed 11 years ago by simon.crowell

Thanks for your help. I'll post a comment about the fix for the rating plugin as well :)

Thanks

comment:3 Changed 11 years ago by balazs.endresz

Btw IDs can't really contain $ signs: http://www.w3.org/TR/html4/types.html#h-6.2

Though it's a bit confusing that in 1.2 you didn't have to escape this, Sizzle seems to be stricter on this.

comment:4 Changed 11 years ago by balazs.endresz

In the example there's a class selector in which the $ sign needs to be escaped but I tried that with an ID and the quickexpr doesn't match an ID that contains any special characters. This hasn't been changed much since 1.2.6 so these expressions are handled by the selector engine, which souldn't be necessary. Or is that intentional?

comment:5 Changed 11 years ago by john

Milestone: 1.31.3.3
Resolution: worksforme
Status: newclosed
Version: 1.31.3.2
Note: See TracTickets for help on using tickets.