Skip to main content

Bug Tracker

Side navigation

#7445 closed bug (invalid)

Opened November 09, 2010 03:16AM UTC

Closed November 09, 2010 03:24AM UTC

Last modified November 11, 2010 08:52PM UTC

attribute selector not support attribute name with '$'

Reported by: Owned by:
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.3
Keywords: Cc:
Blocked by: Blocking:

I did get the result i wanted when i using selector 'p[\\\\$sw="sw"] 。

i found at line 3606 of jquery.js the code "var name = match[1]" ,must be"var name = match[1].replace(/\\\\/g, "")",like at line 3404.

Attachments (0)
Change History (5)

Changed November 09, 2010 03:24AM UTC by snover comment:1

resolution: → invalid
status: newclosed

Thanks for the report but this is not a jQuery bug. $sw is not valid in the name part of a CSS attribute selector. You must escape the $. In the future, please use the jQuery Forum for support requests.

Changed November 09, 2010 04:09AM UTC by anonymous comment:2

i have escape the $ with two backslash,you can see in the bug Description.

Changed November 09, 2010 11:33AM UTC by jitter comment:3

It looks like the reporter forgot to escape the double backslash. As !\\\\ means line break in Trac formatting. So I guess where the linebreaks are the reporter typed !\\\\.

What I don't understand is what the reporter actually reports. The selector documentation explicitly states that you need to double-escape the meta characters in the documentation.

test case that shows we can select by attributes named $sw and that the escaping works as required/documented

Changed November 09, 2010 12:21PM UTC by comment:4

I know the test case can run rightly on google chrome,firefox and ie。but i write the same test case in my computer ,it shows that you can not select by attributes named $sw on ie8.

Changed November 11, 2010 08:52PM UTC by jitter comment:5

When I run the test case I linked to in IE 8 it works as expected. Can you provide a test case on which doesn't work in IE8?