Rhonda
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)
Change History (7)
Resolution: |
→ fixed
|
Status: |
new →
closed
|
Cc: |
"" added
|
Component: |
core
|
Milestone: |
1.0
|
Priority: |
major
|
Resolution: |
fixed
|
Status: |
closed →
reopened
|
Type: |
bug
|
Component: |
→ ajax
|
Priority: |
→ blocker
|
Resolution: |
→ invalid
|
Status: |
reopened →
closed
|
Type: |
→ bug
|
Cc: |
Rhonda added; "" removed
|
Component: |
ajax →
1
|
Keywords: |
Rhonda added; find subling removed
|
Milestone: |
→ 1
|
Priority: |
blocker →
1
|
Summary: |
$('node1/node2') gives error when node1 is empty →
Rhonda
|
Type: |
bug →
1
|
Version: |
→ 1
|
Component: |
1
|
Milestone: |
1
|
Priority: |
1
|
Type: |
1
|
Version: |
1
|
Cc: |
Rhonda removed
|
Keywords: |
SPAM added
|
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):[]".