Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.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
405方法不允许-尝试使用Mootools从YouTube检索JSON提要时发生Firebug错误_Json_Youtube_Mootools - Fatal编程技术网

405方法不允许-尝试使用Mootools从YouTube检索JSON提要时发生Firebug错误

405方法不允许-尝试使用Mootools从YouTube检索JSON提要时发生Firebug错误,json,youtube,mootools,Json,Youtube,Mootools,firebug中出现错误,显然没有内联反馈 “网络错误:不允许使用405方法- 我不知道有什么不对,我可以在浏览器中请求该URL,但request.JSON不能?您不能使用“简单”JSON请求从其他域检索数据(请参阅同源策略)。你应该改用 i、 e var loadVideos = function() { var req = new Request.JSON( { url: 'http://gdata.youtube.com/feeds/api/playlist

firebug中出现错误,显然没有内联反馈

“网络错误:不允许使用405方法-


我不知道有什么不对,我可以在浏览器中请求该URL,但request.JSON不能?

您不能使用“简单”JSON请求从其他域检索数据(请参阅同源策略)。你应该改用 i、 e

var loadVideos = function()
{
    var req = new Request.JSON(
    {
        url: 'http://gdata.youtube.com/feeds/api/playlists/67621C8899ABADA5?alt=json',
        method: 'get',
        onSuccess: function(jsonData)
        {
            //successCode
        }
    }).send();
}
var req = new Request.JSONP(
{
    url: 'http://gdata.youtube.com/feeds/api/playlists/67621C8899ABADA5?alt=json',
    method: 'get',
    onSuccess: function(jsonData)
    {
        //successCode
    }
}).send();