Bug Tracker

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#11120 closed bug (fixed)

Tabs in some selectors break in IE7

Reported by: STHayden Owned by:
Priority: low Milestone: 1.8
Component: selector Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:


example here of some selectors with problems here: http://stefanhayden.com/jquerybug.html

When selecting an element like a div or a ID with a TAB in the beginning or end of a selector jquery throws a error and kills the javascript. It seems having a class in the selector fixes whatever issue there is.

I've tested this is IE7 and IE8 but not IE6. IE8 works fine. I've also tested jquery 1.3 - 1.7.1 and it breaks the same way in all versions. In 1.3 we get a slightly different error

I will include the HTML from the above link but I do not know if the tabs will be preserved in a way the properly recreates the bug. The above link will not change.



<script type="text/javascript" src="ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

<div id="test" class="green">some text</div>



Breaks in IE7 with a tab at the start or end

This error in jquery 1.7.1 - 1.4

SCRIPT5022: Syntax error, unrecognized expression

jquery.min.js, line 3 character 14659

In jquery 1.3 we get a new error in IE7:

SCRIPT5022: Exception thrown and not caught

jquery.min.js, line 19, character 2424


$(" div");

$("div ");

$(" #test");

/* These have a tab but works in IE7 */

$(" .green");

$(" div#test.green")

$(" #test.green")

$(" div.green")




Change History (6)

comment:1 Changed 12 years ago by Timmy Willison

Component: unfiledselector
Priority: undecidedlow
Status: newopen

We can consider clearing tabs from selectors since qsa does it, but this isn't high priority.

comment:2 Changed 12 years ago by STHayden

would it be any easier to just out put a better error? It was a bit of a time sink to track this down. Obviously once I figured it out I just removed the tab in the selector.

comment:3 Changed 11 years ago by Timmy Willison

Milestone: None1.8
Resolution: fixed
Status: openclosed

comment:4 Changed 11 years ago by STHayden

is this bug not listed in the 1.8 release notes because it is not included or just to insignificant to be called out?

comment:5 Changed 11 years ago by Timmy Willison

@STHayden: no, it should have been included automatically by the release script. Not sure what happened.

comment:6 Changed 11 years ago by dmethvin

Yeah, that's strange. The release script polls the bug tracker for everything closed in 1.8, and this should have been picked up. I'll add it to the list manually.

Note: See TracTickets for help on using tickets.