jQuery only takes two parameters on $(). (the second one is optional)

$(expression, context)

http://docs.jquery.com/Core/jQuery#expressioncontext

so your first attempt had 3 parameters.  The last one was ignored.
The second one became the context so jQuery was looking for a tag
<item> in the string "Data" which of course it couldn't find.

Maybe what you wanted was $("item,Data", xml) which will return a last
of item and Data in one jQuery object. It's a matter of placing the
quotes in the right place.

One last comment, jQuery can look through XML but can't parse it so:

$("<data><item>text</item></data>") won't work in IE and is buggy in
FF.  The xml created by an ajax request should work fine though.

David

On Dec 6, 8:37 am, Equand <[EMAIL PROTECTED]> wrote:
> but what's the difference?
> do i need to write separate parsing functions for one and several
> items?
> or i can use $("Data item", xml) selector for both cases?
>
> On Dec 6, 5:31 pm, "Benjamin Sterling"
>
>
>
> <[EMAIL PROTECTED]> wrote:
> > Equand,
> > I think you need to do:
>
> > $("Data item", xml).size()
>
> > On 12/6/07, Equand <[EMAIL PROTECTED]> wrote:
>
> > > when in the root node of xml file i have only one node with text in
> > > it, when i parse this xml using jquery, i' am unable to get the
> > > included node...
> > > for example
> > > <Data>
> > > <item name="test">text</item>
> > > </Data>
>
> > > when i try then $("item", "Data", xml).size()
> > > i will receive 0.
> > > why that happens? that's quite illogical...
>
> > --
> > Benjamin 
> > Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.comhttp://www.benjam...-
> >  Hide quoted text -
>
> - Show quoted text -

Reply via email to