为了账号安全,请及时绑定邮箱和手机立即绑定

具有jsonp内容类型的jQuery.ajax请求后发生parsererror

具有jsonp内容类型的jQuery.ajax请求后发生parsererror

DIEA 2019-12-15 16:08:57
我正在使用jQuery 1.5.1版执行以下ajax调用:$.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); }});服务器使用有效的json对象响应:{  "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"       }     }   } }但是从不调用成功回调,而是由错误回调产生以下输出:jQuery15109935275333671539_1300495251986 was not calledparsererror为什么会这样?我没有使用jQuery的其他库。编辑:如果我尝试使用“ json”作为dataType而不是“ jsonp”来进行ajax调用,则服务器将以空字符串作为响应。
查看完整描述

3 回答

  • 3 回答
  • 0 关注
  • 564 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信