405方法不允许-尝试使用Mootools从YouTube检索JSON提要时发生Firebug错误
firebug中出现错误,显然没有内联反馈 “网络错误:不允许使用405方法-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
我不知道有什么不对,我可以在浏览器中请求该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();