Prototype just fetches XML data. You still need to navigate the XML
tree as you normally would.
On Sep 7, 1:55 pm, malaubli
<Marcus.Lau...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I''m brand new to AJAX and have seen a couple of examples.
>
> To make it as simple as possible, I''m trying to learn to use
> prototype.js to access the <retailprice> of the <product> that
I know
> has a <code> of E260.
>
> I''ve got my Lotus Notes based products.xml file works and looks
like
> this:
>
> <products>
> <product>
> <code>E1</code>
> <quantitydescription>1 Gallon
Can</quantitydescription>
> <retailprice>21</retailprice>
> <dealerprice>0</dealerprice>
> <wholesaleprice>0</wholesaleprice>
> </product>
> <product>
> <code>E260</code>
> <quantitydescription>260 Gallon
Tote</quantitydescription>
> <retailprice>5460</retailprice>
> <dealerprice>0</dealerprice>
> <wholesaleprice></wholesaleprice>
> </product>
> </products>
>
> On my first stab at doing this with prototype.js I got bogged down in
> the muck!
>
> var p = 0;
>
> var products = new Ajax.Request(''/products.xml'', {
> method: ''get'',
> parameters: {code: ''E260'', limit: 12}
> p = // and now just don''t get it! I have to have the sibling
> <retailprice>
> });
>
> Help!
>
> Marcus
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---