使用google feed api解析并呈现mRSS Feed。
我在chrome中遇到问题,因为它没有显示内容......
的 JSFIDDLE
知道为什么会这样吗?...
function initialize() {
var feed = new google.feeds.Feed("http://www.wdcdn.net/rss/presentation/library/client/robotrepair/id/a51a000c78e6997a1b7d422247cad813");
feed.setNumEntries(99);
feed.load(function(result) {
if (!result.error) {
var container = document.getElementById("feed");
for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
var img = document.createElement("img");
if (entry.mediaGroups) {
var imgSrc = entry.mediaGroups[0].contents[0].thumbnails[0].url;
img.setAttribute("src", imgSrc);
container.appendChild(img);
}
}
}
});
}