Bug Tracker

Modify

Ticket #9962 (closed bug: fixed)

Opened 23 months ago

Last modified 10 months ago

When the container has an ID containing a backslash, find( IDselector ) does not find the child.

Reported by: LordPalpatine Owned by:
Priority: low Milestone: 1.8
Component: selector Version: 1.6.2
Keywords: Cc:
Blocking: Blocked by:

Description

Traversing-function "find()" (v.1.6.2) not working anymore. With v1.4.2 no problems. See test-page below, code "$objMain.find('#divEntityData');", "div"-object will not be found.

<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns=" http://www.w3.org/1999/xhtml"> <head>

<title></title> <script src="jQuery/jquery-1.6.2.min.js" type="text/javascript"></script> <script type="text/javascript">

function Test() {

var $objMain = $('.ms-entity-resolved'); var $obj = $objMain.find('#divEntityData');

}

</script>

</head> <body>

<span id="spanKSI\sho" class="ms-entity-resolved">

<div id="divEntityData"></div> <span id="content">KSI\sho </span>

</span>

<button onclick="Test()">Test</button>

</body> </html>

Change History

comment:1 Changed 23 months ago by dmethvin

  • Status changed from new to open

Test case:

 http://jsfiddle.net/dmethvin/9GVYP/

However, that is invalid XHTML. You can't put a block element inside an inline element. Valid markup shows the same behavior:

 http://jsfiddle.net/dmethvin/9GVYP/1/

comment:2 Changed 23 months ago by dmethvin

  • Component changed from unfiled to traversing

comment:3 Changed 23 months ago by timmywil

  • Priority changed from undecided to low
  • Summary changed from find() not working to When the container has an ID containing a backslash, find( IDselector ) does not find the child.
  • Milestone changed from None to 1.next

Seems this is only a problem for an ID selector and only when the container has an ID containing a backslash.

 http://jsfiddle.net/timmywil/3az4F/

comment:4 Changed 11 months ago by dmethvin

  • Component changed from traversing to selector

comment:5 Changed 10 months ago by gibson042

  • Status changed from open to closed
  • Resolution set to fixed
  • Milestone changed from 1.next to 1.8

Fixed in the Sizzle rewrite.

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.