Bug Tracker

Modify

Ticket #11120 (closed bug: fixed)

Opened 2 years ago

Last modified 21 months ago

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:
Blocking: Blocked by:

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>

Change History

comment:1 Changed 2 years ago by timmywil

  • Priority changed from undecided to low
  • Status changed from new to open
  • Component changed from unfiled to selector

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

comment:2 Changed 2 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 22 months ago by timmywil

  • Status changed from open to closed
  • Resolution set to fixed
  • Milestone changed from None to 1.8

comment:4 Changed 21 months 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 21 months ago by timmywil

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

comment:6 Changed 21 months 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.

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.