我试图从这个AJAX调用中获取数据,错误函数被调用,但是我不知道为什么?调试me显示GET工作正常。
这里有什么东西我遗漏了吗?
API密钥可以重新生成,对我来说不是一个安全风险。
$.ajax(
{
type: "GET",
dataType: "jsonp",
url: "https://api.challonge.com/v1/tournaments/christchurch_ranbats_1_melee/participants.json?api_key=UgPJ6Le4jATPLCvRpm0YirZDCX6JvMp13I6MmEVW",
success: function (data) {
console.log(data);
alert("It works");
},
error: function () {
alert("Sorry, could not fetch the data.");
}
});发布于 2015-06-11 23:44:10
您使用的是什么版本的jQuery?jQuery的后期版本使用error而不是failure。
我运行了你的代码,上面说客户端阻止了请求。
https://stackoverflow.com/questions/30793207
复制相似问题