jQuery: The Write Less, Do More JavaScript Library

Ticket #212 (closed 1: invalid)

Opened 2 years ago

Last modified 2 years ago

Rhonda

Reported by: 3568@… Assigned to: anonymous
Type: 1 Priority: 1
Milestone: 1 Component: 1
Version: 1 Keywords: Rhonda
Cc: Rhonda Needs:

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

Change History

Changed 2 years ago by rob.brackett@…

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):[]".

Changed 2 years ago by joern

  • status changed from new to closed
  • resolution set to fixed

sibling() is fixed in SVN.

Changed 2 years ago by substitute

  • status changed from closed to reopened
  • cc set to ""
  • type deleted
  • component deleted
  • priority deleted
  • milestone deleted
  • resolution deleted

Changed 2 years ago by joern

  • priority set to blocker
  • resolution set to invalid
  • status changed from reopened to closed
  • component set to ajax
  • type set to bug

SPAMPOLICE

Changed 2 years ago by Rhonda

  • cc changed from "" to Rhonda
  • component changed from ajax to 1
  • summary changed from $('node1/node2') gives error when node1 is empty to Rhonda
  • priority changed from blocker to 1
  • version set to 1
  • milestone set to 1
  • keywords changed from find subling to Rhonda
  • type changed from bug to 1
Note: See TracTickets for help on using tickets.