Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用Ajax(jquery)调用Deezer API-数据类型JSON返回null-JSONP返回错误_Javascript_Jquery_Ajax_Jsonp_Deezer - Fatal编程技术网

Javascript 使用Ajax(jquery)调用Deezer API-数据类型JSON返回null-JSONP返回错误

Javascript 使用Ajax(jquery)调用Deezer API-数据类型JSON返回null-JSONP返回错误,javascript,jquery,ajax,jsonp,deezer,Javascript,Jquery,Ajax,Jsonp,Deezer,这是我的代码,我建议您测试它: function callDeezerAPI() { $.ajax({ type: 'GET', url: 'http://api.deezer.com/playlist/580739065', dataType: 'jsonp', success: f

这是我的代码,我建议您测试它:

           function callDeezerAPI() {
                $.ajax({
                    type: 'GET',
                    url: 'http://api.deezer.com/playlist/580739065',
                    dataType: 'jsonp',
                    success: function(data) {
                        console.log(data);
                    },
                    error: function(XMLHttpRequest, textStatus, errorThrown) {
                        console.log(XMLHttpRequest);
                        console.log(textStatus);
                        console.log(errorThrown);
                    }
                });
            }
            callDeezerAPI();
我只是想得到相同的结果,就像我去处理这些JSON数据一样

当我使用JSONP数据类型时,我可以通过JQuery错误看到我想要的数据。。。所以我不能用它

如果有人知道如何使用JSON或JSONP(似乎Deezer API接受JSONP…),请告诉我


谢谢大家!

必须通过输出参数指定格式:

http://api.deezer.com/playlist/580739065?output=jsonp

必须通过输出参数指定格式:

http://api.deezer.com/playlist/580739065?output=jsonp