Google Geo API Analysis (Reverse Geocoding) with jQuery

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?

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:

enter image description here

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.

Why can't jQuery parse / read the answer?

+2
source share
4

googles . . .

+3

, Bjorn - , . , , , ajax - , , .

Shidhin Cr, , callback =?, , , - , jQuery , dataType "jsonp".

, $.getJSON, , jsonp - , , , , jquery, .

, .

+3

. ,

data: 'latlng=' + geolocation + '&sensor=false&callback=?'
+1

$.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);
     }
})
+1

All Articles