Side navigation
#212 closed (invalid)
Opened September 25, 2006 05:02PM UTC
Closed October 26, 2006 02:19PM UTC
Last modified November 08, 2006 12:55PM UTC
Rhonda
| Reported by: | 3568@emailias.com | Owned by: | |
|---|---|---|---|
| Priority: | Milestone: | ||
| Component: | Version: | ||
| Keywords: | Rhonda,SPAM | Cc: | |
| Blocked by: | Blocking: | 
Description
If I have document
<div id=lst></div>
then
$(‘#lst/div’).length gives error, but $(‘#lst’).find(‘div’).length gives 0
Rev: 249 Date: 2006-08-31 13:26:31 -0400 (Thu, 31 Aug 2006)
Attachments (0)
Change History (7)
Changed September 25, 2006 05:25PM UTC by comment:1
Changed October 06, 2006 02:33PM UTC by comment:2
| resolution: | → fixed | 
|---|---|
| status: | new → closed | 
sibling() is fixed in SVN.
Changed October 26, 2006 12:35PM UTC by comment:3
| cc: | → "" | 
|---|---|
| component: | core | 
| milestone: | 1.0 | 
| priority: | major | 
| resolution: | fixed | 
| status: | closed → reopened | 
| type: | bug | 
Changed October 26, 2006 02:19PM UTC by comment:4
| component: | → ajax | 
|---|---|
| priority: | → blocker | 
| resolution: | → invalid | 
| status: | reopened → closed | 
| type: | → bug | 
SPAMPOLICE
Changed November 08, 2006 12:55PM UTC by comment:5
| cc: | "" → Rhonda | 
|---|---|
| component: | ajax → 1 | 
| keywords: | find subling → Rhonda | 
| milestone: | → 1 | 
| priority: | blocker → 1 | 
| summary: | $('node1/node2') gives error when node1 is empty → Rhonda | 
| type: | bug → 1 | 
| version: | → 1 | 
Changed October 24, 2010 09:22PM UTC by comment:6
| component: | 1 | 
|---|---|
| milestone: | 1 | 
| priority: | 1 | 
| type: | 1 | 
| version: | 1 | 
Changed October 24, 2010 09:28PM UTC by comment:7
| cc: | Rhonda | 
|---|---|
| keywords: | Rhonda → Rhonda,SPAM | 
The same problem also occurs with "#lst > div". This seems to be because the method for evaluating the ">" and "/" tokens sends #lst's firstChild to jQuery.sibling(), which then tries to get its parentNode. Boom! Null element reference doesn't have a parentNode! It can probably be fixed by
A) making jQuery.sibling() check for a null value for its 'elem' argument or
B) changing jQuery.token[3] to something like "a.firstChild?jQuery.sibling(a.firstChild):[]".