Skip to main content

Bug Tracker

Side navigation

#11139 closed bug (invalid)

Opened January 07, 2012 02:24PM UTC

Closed January 08, 2012 03:15PM UTC

Last modified March 14, 2012 10:14AM UTC

Repeating identical selector results in error in IE7

Reported by: theallan Owned by: theallan
Priority: low Milestone: None
Component: selector Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

It would appear that if you call an identical selector to the previous selector, IE7 will throw an error.

To reproduce simply open IE and the developer tools. Put the document into IE7 mode and then run:a

$('a')
$('a')

the second one will result in a Sizzle error being reported:

"Syntax error, unrecognized expression: a"

Also tested with the current nightly ( f724bc6c921378b82d9d6fa17329b6451fbb7a51 ).

I know its generally not a good idea to repeat selectors like this, so this error could be seen as a good thing to encourage authors (like me...!) to reuse jQuery objects - however, throw an error (which itself is very misleading) in IE7 but not other browsers doesn't seem quite right.

Attachments (0)
Change History (3)

Changed January 07, 2012 05:58PM UTC by ajpiano comment:1

owner: → theallan
status: newpending

Thanks for taking the time to contribute to the jQuery project! I've made a simple test case (on the latest edge build) that when run in ie7 mode does not throw the error you described. http://jsfiddle.net/ajpiano/ZpjGb/show/ . If you can provide us with a test case that reproduces the error, please do so. Thanks.

Changed January 08, 2012 08:38AM UTC by theallan comment:2

status: pendingnew

I'm somewhat embarrassed about filing this against jQuery - it turns out it isn't a jQuery bug at all! I included a regexp library that overrides String.prototype.split and various other core methods, and there was a bug in that which was causing Sizzle to go haywire in IE7.

My apologies, but this bug should be closed as invalid!

Changed January 08, 2012 03:15PM UTC by sindresorhus comment:3

component: unfiledselector
priority: undecidedlow
resolution: → invalid
status: newclosed