I have this json from google api:
{
"results" : [
{
"formatted_address" : "1 Broadway, New York, NY 10021, USA",
}
],
"status" : "OK"
}
how to get the value of "formatted_address"?
with this code (using jquery) I only get "results is Array"
$.getJSON(jsonFile, function(data){
$.each(data, function(key, val){
alert(key + ' is ' + val);
});
});
In php it is very easy but I need this to be client-side
data.results[0].formatted_address