[英]ajax google map - {“readyState”:4,“status”:200,“statusText”:“success”} with parsererror
here's the ajax call 这是ajax电话
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
. 我尝试了
jsonp
, json
作为dataType
。 but it still call back the parsererror
error. 但它仍会回调
parsererror
错误。 also tried to modify the url_map adding &output=json
or/and removing the ?callback?
还尝试修改url_map以添加
&output=json
或/并删除“ ?callback?
parameter. 参数。 is there a way to catch a detailed error instead a generic
parsererror
? 有没有办法捕获详细的错误而不是通用的
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
我需要得到那个坐标的国家
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.