我正在使用Google Feed JSAPI来阅读/解析Feed.问题是,当Feed更改时,先前的条目变为无效(链接和图像不起作用),因此我无法加载源的缓存版本.我认为加载Feed时可以选择不使用缓存版本,但我没有看到.我的解决方案是在变量(t)中添加到feed url的末尾,因此它是"唯一的"但这看起来很糟糕(但它确实有效).有人知道更好的方法吗?
function onLoad() {
// Create a feed instance that will grab feed feed.
var feed = new google.feeds.Feed(feedLocation+"&t="+new Date().getTime());
// Request the results in XML (so that we can parse out all the info
feed.setResultFormat(google.feeds.Feed.XML_FORMAT);
//must set this - if you don't, it defaults to 4
feed.setNumEntries(50);
// Calling load sends the request off. It requires a callback function.
feed.load(feedLoaded);
}
Run Code Online (Sandbox Code Playgroud) 我有一个网页,主要是基本的HTML.有一个部分我使用JavaScript从外部源(url)加载RSS源.问题是我的页面将加载所有内容,直到该脚本,等待脚本加载(有时最多几秒),然后加载页面的其余部分.
如何在首先渲染整个页面后强制它加载脚本?
我的代码是这样的:
<html>
<more html>
<script language="JavaScript" src="http://..." type="text/javascript"></script>
<more html>
...
Run Code Online (Sandbox Code Playgroud) 好吧,我发现这个RSS插件,我想在网页中显示它,但我希望它在jQuery列表视图中,所以每个项目都是一个列表项,有人可以向我解释如何做到这一点?我把jsfiddle链接放在下面!谢谢
http://jsfiddle.net/8qhZP/
这是我找到插件的实际来源
http://www.jquery4u.com/plugins/jquery-rss-feed-display-live/