I am sure that I am not the only one, but I can not parse / return anything when jQuery accepts a request to search for an address, when the requested data is latitudeand longitude, therefore, Google can return data, but it can not be read by jQuery?
latitude
longitude
http://maps.googleapis.com/maps/api/geocode/json
With parameters:
latlng=51.276914,1.077252 &sensor=false
Firebug says 200 OK, but nothing appears in the answer:
200 OK
I see this when I open it: http://maps.googleapis.com/maps/api/geocode/json?latlng=51.187296,1.229086&sensor=false&_=1302084865163
What I've done:
$.ajax( { url: 'http://maps.googleapis.com/maps/api/geocode/json', data: 'latlng=' + geolocation + '&sensor=false', dataType: 'json', cache: false, success: function(data){ alert(data); } });
It doesn't work ... neither $.get, $.getJSONp json dataType.
$.get
$.getJSON
json
dataType
Why can't jQuery parse / read the answer?
googles . . .
, Bjorn - , . , , , ajax - , , .
Shidhin Cr, , callback =?, , , - , jQuery , dataType "jsonp".
, $.getJSON, , jsonp - , , , , jquery, .
, .
. ,
data: 'latlng=' + geolocation + '&sensor=false&callback=?'
$.getJSON,
var latlng = "40.06125658,-7.745361328"; var url = "https://maps.googleapis.com/maps/api/geocode/json?latlng=" + latlng + "&sensor=false"; $.getJSON(url, function (data) { for(var i=0;i<data.results.length;i++) { var adress = data.results[i].formatted_address; alert(adress); } })