getAllChildren bug on space CSS selector

View: New views
3 Messages — Rating Filter:   Alert me  

getAllChildren bug on space CSS selector

by c2c :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


As I read on this groups, using a CSS selector like "#nonexistantDiv
span" where #nonexistantDIv points to nothing, getAllChildren throws
an error about "e" not being defined.

As just returning an empty array like this :

function getAllChildren(e) {
  // Returns all children of element. Workaround required for IE5/
Windows. Ugh.
  if (!e) {
  return new Array();
  }
  return e.all ? e.all : e.getElementsByTagName('*');
}

gives a solution, wouldn't it be nice to put it in behaviour.js ?

Regards,

--
Julien CROUZET aka c2c
julien/at\theoconcept.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Behaviour Javascript Library" group.
To post to this group, send email to behaviour@...
To unsubscribe from this group, send email to behaviour-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/behaviour?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: getAllChildren bug on space CSS selector

by bnolan@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It certainly would. :) I'll see what I can do. :)

Ben

On 8/18/07, c2c <julien.crouzet@...> wrote:

As I read on this groups, using a CSS selector like "#nonexistantDiv
span" where #nonexistantDIv points to nothing, getAllChildren throws
an error about "e" not being defined.

As just returning an empty array like this :

function getAllChildren(e) {
  // Returns all children of element. Workaround required for IE5/
Windows. Ugh.
  if (!e) {
        return new Array();
  }
  return e.all ? e.all : e.getElementsByTagName('*');
}

gives a solution, wouldn't it be nice to put it in behaviour.js ?

Regards,

--
Julien CROUZET aka c2c
julien/at\theoconcept.com







--
Regards,
Ben Nolan

http://bennolan.com/

skype: bennolan
cell: +49 1577 383 7542
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Behaviour Javascript Library" group.
To post to this group, send email to behaviour@...
To unsubscribe from this group, send email to behaviour-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/behaviour?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: getAllChildren bug on space CSS selector

by c2c :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 18 août, 21:11, "Ben Nolan" <bno...@...> wrote:
> It certainly would. :) I'll see what I can do. :)
>

Thanks, adding thins manually on each Behaviour update is
not the best solution ... :)

Thanks again,

--
Julien CROUZET aka c2c
julien/at\theoconcept.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Behaviour Javascript Library" group.
To post to this group, send email to behaviour@...
To unsubscribe from this group, send email to behaviour-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/behaviour?hl=en
-~----------~----~----~----~------~----~------~--~---