here's the ajax call
var url_map = "http://maps.googleapis.com/maps/api/geocode/json?latlng="+lat+","+lon+"&sensor=false?callback?";
$.ajax({
type: "GET",
dataType : "json",
url: url_map,
crossDomain:true,
success: function(data){
console.log("success");
},
error: function(e){
console.log(JSON.stringify(e);
}
)};
I tried jsonp
,json
as dataType
. but it still call back the parsererror
error. also tried to modify the url_map adding &output=json
or/and removing the ?callback?
parameter. is there a way to catch a detailed error instead a generic parsererror
?
what's wrong with my code?
EDIT
in my opinion, it's not a duplicate of the link mentioned. I already have the lat and long. I need to get the country of that coordinates