Side navigation
#9962 closed bug (fixed)
Opened August 03, 2011 03:05PM UTC
Closed August 16, 2012 04:50PM UTC
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: | ||
| Blocked by: | Blocking: |
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>
Attachments (0)
Change History (5)
Changed August 03, 2011 03:26PM UTC by comment:1
| status: | new → open |
|---|
Changed August 03, 2011 03:27PM UTC by comment:2
| component: | unfiled → traversing |
|---|
Changed August 03, 2011 03:29PM UTC by comment:3
| milestone: | None → 1.next |
|---|---|
| priority: | undecided → low |
| summary: | find() not working → When the container has an ID containing a backslash, find( IDselector ) does not find the child. |
Seems this is only a problem for an ID selector and only when the container has an ID containing a backslash.
Changed July 12, 2012 01:49AM UTC by comment:4
| component: | traversing → selector |
|---|
Changed August 16, 2012 04:50PM UTC by comment:5
| milestone: | 1.next → 1.8 |
|---|---|
| resolution: | → fixed |
| status: | open → closed |
Fixed in the Sizzle rewrite.
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/