我尝试解析通过AJAX一个Google Alert
饲料,但我得到的例外。这是我的尝试:解析谷歌警报饲料
$(document).ready(function() {
$.ajax({
url: 'http://www.google.com/alerts/feeds/01662123773360489091/16526224428036307178',
type: 'GET',
dataType: "xml"
}).done(function(xml) {
$.each($("item", xml), function(i, e) {
$("#results").append($("enclosure").attr("url").text() + "<br />");
});
});
});
,但我得到:
XMLHttpRequest cannot load http://www.google.com/alerts/feeds/01662123773360489091/16526224428036307178. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
任何帮助吗?
P.S:我已经看过几个职位有关分析RSS通过AJAX和jQuery饲料,但他们没有为我工作。
看起来像一个跨域问题。 [这个网站](http://cypressnorth.com/programming/cross-domain-ajax-request-with-xml-response-for-iefirefoxchrome-safari-jquery/)有一些方法的说明。 –