亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

具有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 關注
  • 641 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號