Reputation: 85
I'm trying to get Location name from a JSON data. I did it with:
var adsress = JSON.stringify(dataa.Response.ResourceSets.ResourceSet.Resources.Location.Address.AddressLine["#text"]);
but when I changed the location point I can't do the same since it shows:
Cannot get ['#text'] of null or undefined var
The result( JSON data ):
"Resources":{"Location":[{"Name":{"#text":"Rue Ibnou Battouta, Agadir, Morocco"}
Upvotes: 0
Views: 140
Reputation: 491
data.Response.ResourceSets.ResourceSet.Resources.Location
is an array.
Try
data.Response.ResourceSets.ResourceSet.Resources.Location[0].Address.AddressLine["#text"]
Upvotes: 1