我正在使用 Google feed API 在我的网站中加载 rss。https://developers.google.com/feed/v1/devguide
中提到的程序适用于从链接中获取 rss。
var feed = new google.feeds.Feed("https://stackoverflow.com/feeds");
//other Codes
google.setOnLoadCallback(myFunction);
我的方案是在我的网站中为动态链接加载多个 rss 提要
例如,如果链接如下:
- http://www.codeplex.com/site/feeds/rss
- https://stackoverflow.com/feeds
- http://fastpshb.appspot.com/feed/1/fastpshb/rss
$('li').each(function(index, value)
{
var text = $(this).text();
var feed = new google.feeds.Feed(text);
});
//Other Codes
google.setOnLoadCallback(myFunction);
仅获取最后一个链接的 rss。
在此链接https://developers.google.com/feed/v1/reference#resultFind
上提到
.setOnLoadCallback(callback) 是一个静态函数,它注册要在包含此调用的页面加载后调用的指定处理程序函数,其中 callback 是在加载包含文档并且 API 可供使用时调用的必需函数(例如,在 onLoad 之后)。
这是 .setOnLoadCallback 执行最后一个链接的原因吗?
这个问题的解决方案是什么?