如何将此 RSS 提要放入 jQuery 列表视图中?
好吧,我找到了这个 RSS 插件,我想在网页中显示它,但我希望它在 jQuery 列表视图中,所以每个项目都是一个列表项目,有人可以向我解释一下该怎么做吗?我把jsfiddle链接放在下面了!谢谢
http://jsfiddle.net/8qhZP/
这是我找到该插件的实际来源
http://www.jquery4u.com/plugins/jquery-rss-提要显示实时/
Okay I found this RSS plugin and I want to display it inside a webpage, but I want it to be in a jQuery listview, so each item is a list item, could someone please explain to me how to do it? I put the jsfiddle link below! Thanks
http://jsfiddle.net/8qhZP/
And this is the actual source where I found the plugin
http://www.jquery4u.com/plugins/jquery-rss-feed-display-live/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
实现此目的的最简单方法是将 RSS 提要转换为 JSON 对象。这样您就可以使用 JSONP 调用 url,然后使用 jQuery 模板引擎解析输出。
1) 使用 Yahoo Pipes 将 RSS feed 转换为 JSON feed(也可以合并 RSS feed)
http://jquery4u.com/ rss/
变为
Yahoo JSON Pipe Output
2) 使用 jQuery 渲染 JSON feed模板引擎如 json2html
Easiest way to accomplish this is to get the RSS feed converted into a JSON object. This way you can call the url using JSONP and then parse the output using a jQuery template engine.
1) Convert the RSS feed into a JSON feed using Yahoo pipes (can also combine RSS feeds)
http://jquery4u.com/rss/
into
Yahoo JSON Pipe Output
2) Render the JSON feed using a jQuery templating engine like json2html
如果您没有被迫使用 jquery feed rss live 插件 你指出,那么你可以使用 其他插件:解析 RSS jQuery。
stackoverflow 上的另一篇文章也对此进行了讨论:使用 jquery 解析 rss 并附有示例和一些文档。
因此,重用 Nathan Strutz 给出的示例
你可以这样做:
希望它符合你的需求。
If you are not forced to use the jquery feed rss live plugin you point out, then you could use that other plugin: Parse RSS with jQuery.
It's also discussed on another post on stackoverflow: parse rss with jquery with examples and some documentation.
So, reusing the example given by Nathan Strutz
you could just do something like:
Hope it fits your needs.
RSS 插件似乎默认生成一个列表。 演示页面 生成段落,但这是因为它已明确配置为在源代码包含此行:
newsfeed.setentrycontainer("p");
从配置中取出此行应生成 html 列表。
我对 jQuery 列表视图了解不多(它适用于移动页面,对吧?),但我想如果您在加载 RSS 提要之后初始化 jQuery 列表视图,它应该可以工作。
祝你好运!
The RSS plugin seems to generate a list by default. The demo page generates paragraphs, but that's because it's explicitly configured to do that in the source with this line:
newsfeed.setentrycontainer("p");
Taking this line out of the config should generate the html list.
I don't know much about the jQuery listview (it's for mobile pages right?), but I guess that if you initialise the jQuery listview after the RSS feed is loaded, it should work.
Good luck!