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

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

发布时间:2020-12-15 21:36:11 所属栏目:百科 来源:网络整理
导读: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: (jqXHR,textStatus,errorThrown) { console.log(errorThrown); console.log(textStatus); }
});
The server responds with a valid json object:

?
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"response" : {
"type" : "category" "entries" :1,monospace!important; font-size:1em!important; padding:0px!important; color:blue!important; border:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; line-height:1.1em!important; margin:0px!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; width:auto!important; min-height:auto!important; background:none!important">"params" :{
"format" "json" "api_key" "c9f11509529b219766a3d301d9c988ae9f6f67fb" "id" "406" "callback" "jQuery15109935275333671539_1300495251986" "_" "1300495252693"
},
"pages" "result" :{
:{
"product_count" :0,
:406,
"restful_path" "/categories/406" "parent_id" : null "name" "Oberteile"
}
}
}
}

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


答案详见:点击打开链接

(编辑:李大同)

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

    推荐文章
      热点阅读