I think data2.children("file") is the equivalent of data2.find("> file").
It will only match direct descendants of the root node.
Try using .find instead, like this:
[code]
var tmp = data2.find("file");
alert("files : " + tmp.length);
[/code]
PS.: forgive me if I'm wrong, I haven't checked this, I'm just guessing!
2008/10/13 Lideln <[EMAIL PROTECTED]>
>
> Hi all,
>
> I fell on what seems to be a big issue (for me at least !).
> I have that ajax call that returns an xml tree.
> For example :
> dir
> --- dir
> --- --- file
> --- --- file
> --- dir
> --- --- file
> --- file
> --- file
> file
> file
>
> When I do that code :
> [code]
> var tmp = data2.children("file");
> alert("files : " + tmp.length);
> [/code]
> It tells me "files : 2" in firefox 3 (the proper answer), and it tells
> me "files : 0" in firefox 2 (bad answer)
> (where data2 is a "dir" xml node)
>
> If someone knows something about that issue, I would be very pleased
> to hear it, since this is the first time I get a different behavior
> for parsing XML with jquery in firefox 2 and firefox 3.
>
> Thanks a lot !
>
>
> >
>
--
Cheers,
Diego A.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---