0
直到昨天,此代碼才起作用。但今天I'm有此錯誤:Google RSS和Ajax昨天停止工作
類型錯誤:xml.responseData是空
CODE:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
$(function(){
var object001 = new Object();
url = 'https://news.google.com/news?cf=all&hl=en&pz=1&ned=us&csid=09160b44f4732e03&output=rss';
$.ajax({
type: "GET",
url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=1000&callback=?&q=' + encodeURIComponent(url),
dataType: 'json',
error: function(){
alert('Error!');
},
success: function(xml){
var values = xml.responseData.feed.entries;
console.log(values);
}
});
});
</script>
任何人都知道這是爲什麼?謝謝!
http://stackoverflow.com/questions/34049813/loading-rss-feed-with-ajax-alternatives-to-google-feed-api –