【发布时间】:2014-02-07 05:55:40
【问题描述】:
我正在尝试使用 jquery json 执行一些基本操作。
var urlPath= encodeURIComponent('{"fields":"subject,course,unit,topic,lesson"}');
$.ajax({
url : 'http://abcd.org/proficiency.json?data'+urlpath,
type : 'GET',
dataType : 'jsonp',
contentType: "application/json",
success : function(data) {
console.log("success");
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
console.log(XMLHttpRequest, textStatus, errorThrown);
}
});
错误回调总是触发
错误... parsererror jQuery15001997238997904205_1298484897373 未被调用。
如何解决?
感谢阅读..
【问题讨论】:
-
服务器真的返回JSONP吗?请发布响应示例。
-
@Aaron:错了。 JSONP 和 JSON 是两个不同的东西。
-
错误的数据类型。只需删除 JSONP
-
您确定这是正确的网址吗?
-
@RUJordan,网址是正确的。
标签: javascript jquery json