我正在尝试使用Google Feed向我的网站添加RSS Feed。问题是它会剪切条目数。我只看到4个条目,但当我卷曲RSS时,我看到28个条目。如何加载其余条目。
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script language="JavaScript">
google.load("feeds", "1");
function initialize() {
var feed = new google.feeds.Feed("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/erss.cgi?rss_guid=1zYrsILa0sOsmYw2yBRKaeHt9hnGCeczWTLrGvu39KX1g_ZMyr");
feed.load(function(result) {
alert(result.feed.entries);
if (!result.error) {
var container = document.getElementById("feed");
var text = "";
for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
text += "<a href='" + entry.link + "'>" + entry.title + "</a><br />" + entry.description + "<br /><br />";
}
container.innerHTML = text;
}
});
}
google.setOnLoadCallback(initialize);
</script>
和html
<div id="feed">Loading...</div>
答案 0 :(得分:1)