Skip to main content

Bug Tracker

Side navigation

#11120 closed bug (fixed)

Opened December 30, 2011 02:37PM UTC

Closed July 03, 2012 02:31AM UTC

Last modified August 10, 2012 12:02AM UTC

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:
Description

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.

<html>

<body>

<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>

<script>

/*

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")

</script>

</body>

<html>

Attachments (0)
Change History (6)

Changed December 30, 2011 04:03PM UTC by timmywil comment:1

component: unfiledselector
priority: undecidedlow
status: newopen

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

Changed December 30, 2011 05:47PM UTC by STHayden comment:2

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.

Changed July 03, 2012 02:31AM UTC by timmywil comment:3

milestone: None1.8
resolution: → fixed
status: openclosed

Changed August 09, 2012 10:44PM UTC by STHayden comment:4

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

Changed August 09, 2012 11:33PM UTC by timmywil comment:5

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

Changed August 10, 2012 12:02AM UTC by dmethvin comment:6

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.