On 12 Jul 2008, at 03:08, Jeff.Corcoran wrote:
>
> Ok, I have the following JSON string (some things are removed for
> privacy):
>
> addresses = [{"address": {"lng":
"-178.7098","lat": "43.2818"}},
> {"address": {"lng":
"-178.7041","lat": "43.2789"}},
{"address":
> {"lng": "-178.7004","lat":
"43.273"}}]
>
> and I am attempting to call them like so:
>
> for(i=0;i<addresses.length;i++) {
> alert( addresses[i].lat);
> }
the way you''ve got your json setup you need to be poking
addreses[i].address.lat
Fred>
>
> However, the alert comes back saying "undefined".
>
> Any idea what I am doing wrong?
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---