简体   繁体   English

ajax谷歌地图-{“ readyState”:4,“ status”:200,“ statusText”:“ success”}} with parsererror

[英]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 . 我尝试了jsonpjson作为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 我需要得到那个坐标的国家

as mentioned in the link below and in the comments, googleapis doesn't provide jsonp ajax requests anymore. 如以下链接和评论中所述,googleapis不再提供jsonp ajax请求。

this solved my problem. 解决了我的问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AJAX获取请求JSONP分析器错误:readyState“:4,” status”:200,“ statusText”:“ load”}] - AJAX get request JSONP parsererror: readyState“:4,”status“:200,”statusText“:”load"}] 错误回调{{readyState“:4,”status“:200,”statusText“:”success“} - error callback with {“readyState”:4,“status”:200,“statusText”:“success”} jquery ajax调用使用readystate 4,状态200,statustext ok返回错误 - jquery ajax call returning an error with readystate 4, status 200, statustext ok AJAX发布-{“ readyState”:0,“ responseText”:“”,“ status”:0,“ statusText”:“ error”} - AJAX post - {“readyState”:0,“responseText”:“”,“status”:0,“statusText”:“error”} jquery ajax readystate 0 responsetext status 0 statustext error - jquery ajax readystate 0 responsetext status 0 statustext error jQuery ajax响应“ readyState”:0,“状态”:0,“ statusText”:“错误” - jquery ajax response “readyState”:0,“status”:0,“statusText”:“error” 在readystate 0,status 0和statusText错误上跟踪AJAX错误 - Tracking AJAX error on readystate 0, status 0 and statusText error {"readyState":0",status:"0",statusText":error"} - {"readyState":0",status:"0",statusText":error"} jQuery Ajax错误{“ readyState”:0,“ responseText”:“”,“ status”:0,“ statusText”:“ OK”} - JQuery Ajax Error {“readyState”:0,“responseText”:“”,“status”:0,“statusText”:“OK”} Ajax返回带有额外readyState,responseText,status和statusText的JSON对象 - Ajax return JSON object with extra readyState, responseText, status and statusText
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM