我正在使用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 回答
- 0 關注
- 641 瀏覽
添加回答
舉報
0/150
提交
取消