anyone?
On 31 mar, 19:35, "edgardo.garza" <[email protected]> wrote: > hello, it´s my first message, and i really need help i just dont know > how to acces data from the JSON archive that generates the geocoder > API for example this: > > { > "status": "OK", > "results": [ { > "types": [ "locality", "political" ], > "formatted_address": "Washington D. C., Distrito de Columbia, > EEUU", > "address_components": [ { > "long_name": "Washington D. C.", > "short_name": "Washington D. C.", > "types": [ "locality", "political" ] > }, { > "long_name": "Distrito de Columbia", > "short_name": "DC", > "types": [ "administrative_area_level_1", "political" ] > }, { > "long_name": "Estados Unidos", > "short_name": "US", > "types": [ "country", "political" ] > } ], > > ok, i can acces using this: > > document.getElementById('name').value = > results[0].address_components[3].long_name; > > and it shows, "Estados Unidos". > > but I want to access it this way: > > results[0].address_components.long_name.types.country.political > > i know this is incorrect, but i wanna acces to the data without using > a number in "address_components[x]" > > thanks. > > BTW sorry for my english -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" 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/google-maps-js-api-v3?hl=en.
