加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ajax jsonp parsererror原因及解决方法(不是格式问题!)

发布时间:2020-12-16 01:31:54 所属栏目:百科 来源:网络整理
导读:I am using jQuery Version 1.5.1 to do the following ajax call: ? 1 2 3 4 5 6 7 $.ajax({ dataType: 'jsonp' , data: { api_key : apiKey }, url: "http://de.dawanda.com/api/v1/" + resource + ".json" , success: function (data) { console.log(data

I am using jQuery Version 1.5.1 to do the following ajax call:

?
1
2
3
4
5
6
7
$.ajax({
dataType: 'jsonp' ,
data: { api_key : apiKey },
url: "http://de.dawanda.com/api/v1/" + resource + ".json" ,
success: function (data) { console.log(data); },
error: function (jqXHR,textStatus,errorThrown) { console.log(errorThrown); console.log(textStatus); }
});
The server responds with a valid json object:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"response" : {
"type" : "category" ,
"entries" :1,
"params" :{
"format" : "json" ,
"api_key" : "c9f11509529b219766a3d301d9c988ae9f6f67fb" ,
"id" : "406" ,
"callback" : "jQuery15109935275333671539_1300495251986" ,
"_" : "1300495252693"
},
"pages" :1,
"result" :{
"category" :{
"product_count" :0,
"id" :406,
"restful_path" : "/categories/406" ,
"parent_id" : null ,
"name" : "Oberteile"
}
}
}
}

But the success callback is never called,instead the error callback produces this output:


答案详见:点击打开链接

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读