【发布时间】:2017-06-28 19:57:59
【问题描述】:
我正在发出 API 请求,但我不知道为什么会一直发生这种情况。
当我检查网络选项卡时,我请求的数据是正确的,但它不会在控制台中打印出来。
我正在使用 Musixmatch API
有什么想法吗?
$.ajax({
type: "GET",
data: {
"apikey": musixmatch,
"q_track": song,
"q_artist": artist,
"format":"json",
},
url: "https://api.musixmatch.com/ws/1.1/matcher.track.get",
dataType: "jsonp",
contentType: 'application/json',
success: function(response)
{
console.log(response);
}
});
【问题讨论】:
-
在哪一行出错?
-
错误源于API,根本不返回JSONP,因此无法解析
标签: jquery json ajax get syntax-error