带有{" readyState":4," status":200," statusText":" success"}的错误回调 [英] error callback with {"readyState":4,"status":200,"statusText":"success"}

查看:135
本文介绍了带有{" readyState":4," status":200," statusText":" success"}的错误回调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个 url 电话。 url按预期返回一个json对象(直接浏览器调用),但是当我通过带有后续行的ajax执行此操作时

I have this url call. the url returns a json object as expected (direct browser call) but when I do that via ajax with the follow lines

$.ajax({
       url: url, 
       type: "GET",
       dataType:"jsonp",   
       success: function(data) {
          alert(data);
       },
       error : function(error) {
          alert("no good "+JSON.stringify(error));
       }
});

它还给我

no good {"readyState":4,"status":200,"statusText":"success"}

我知道stackoverflow上有其他类似的问题,但似乎没有人解决它。

I know there's others similar questions on stackoverflow, but nobody seems solved it.

推荐答案

这表明HTTP请求成功但尝试解析数据不是。

That suggests that the HTTP request was successful but the attempt to parse the data was not.

即数据未格式化为JSONP。

i.e. that the data was not formatted as JSONP.

这篇关于带有{" readyState":4," status":200," statusText":" success"}的错误回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆