Reputation: 436
Sorry if this looks like simple but please help me finding a solution.
When I call an API it returns response and I need to find "Latitude" and "Longitude" values from it. I am not able to make it work. I use JQuery/JavaScript.
Response form API:
{"Data":[{"DeviceName":"HAY-JOVAN-5103657285","DeviceID":"10941818","Date":"2015-08-12T17:02:42-07:00","Latitude":37.65438,"Longitude":-122.13830,"Type":"GPS","Speed(mph)":0,"Speed(km/h)":0,"Altitude(ft)":-82,"Altitude(m)":-25,"Accuracy":11}]}
When tried something like this but not what I want:
$.each(jsonResult, function () {
$.each(this, function (k, v) {
console.log("k:" + k, " v:" + v);
});
});
Can you please help me finding "Latitude" and "Longitude" values from it?
Upvotes: 0
Views: 24
Reputation: 152216
Just try with:
console.log('Latitude', v.Latitude);
console.log('Longitude', v.Longitude);
Upvotes: 1