我正在使用Google feed API在我的网站中加载RSS。
https://developers.google.com/feed/v1/devguide中提到的过程适用于从链接中获取rss。使用Google API动态rss链接的多个Feed在一个网站上
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(回调)是注册指定的处理函数被调用静态函数一次包含此调用加载页面,在回调时调用所需的功能包含文档被加载并且API可以使用(例如,在onLoad之后)。
难道这就是.setOnLoadCallback执行最后一个链接的原因吗?
这个问题的解决方案是什么?