Bug Tracker

Modify

Ticket #11837 (closed bug: invalid)

Opened 12 months ago

Last modified 12 months ago

selector not working for long ids

Reported by: reuben@… Owned by:
Priority: low Milestone: None
Component: selector Version: 1.7.2
Keywords: Cc:
Blocking: Blocked by:

Description

I have a long div id and jquery dosn't select it but good old getDocumentById does.

proof:  http://jsfiddle.net/FnMxV/1/

firefox 12 (firebug) IE 9

All jQuery versions on jsFiddle fail this

Change History

comment:1 Changed 12 months ago by sindresorhus

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to selector

It chokes on the =

From the jQuery selectors docs:

If you wish to use any of the meta-characters ( such as !"#$%&'()*+,./:;<=>?@[\]`{|}~ ) as a literal part of a name, you must escape the character with two backslashes:
. For example, if you have an element with id="foo.bar", you can use the selector $("#foo
.bar"). The W3C CSS specification contains the complete set of rules regarding valid CSS selectors. Also useful is the blog entry by Mathias Bynens on CSS character escape sequences for identifiers.

If you escape the = with \\ it works.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.