最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to show rss feeds with image using javascriptjquery - Stack Overflow

programmeradmin0浏览0评论

How can i show Rss feeds with images using jquery? I tried some very popular plugins like:
1. gFeed
2. jfeed
3. zRssfeed

But nothing seems to support images. What is the best and easiest way to do this? Are there any plugins already available?

How can i show Rss feeds with images using jquery? I tried some very popular plugins like:
1. gFeed
2. jfeed
3. zRssfeed

But nothing seems to support images. What is the best and easiest way to do this? Are there any plugins already available?

Share Improve this question asked Aug 14, 2011 at 8:05 esafwanesafwan 18.1k35 gold badges110 silver badges170 bronze badges 1
  • Did my answer not help? Or did I misunderstand your problem? – Ali Commented Aug 15, 2011 at 13:10
Add a ment  | 

2 Answers 2

Reset to default 3

The zRSSFeed plugin does support images within feeds. By default the plugin will show an abbreviated description. To include images set the 'snippet' option to 'false'.

For example:

$(document).ready(function () {
    $('#ticker1').rssfeed('http://feeds.bbc.co.uk/iplayer/highlights/tv/list',{
        snippet: false
    });
});

For an online example see:

http://zazar/developers/jquery/zrssfeed/example_images.html

You should be able to fetch RSS using simple jQuery ajax call. Something like

$.ajax({
      accept: 'application/rss+xml',
      url: 'http://rss.cnn./fortunebrainstormtech',
      success: function(){}
});

Using the URL above, I can see that images are return as HTML <img> (escaped ofcourse) tags. You just need to unescape them and embed them in your html.

To unescampe simple using the javascript unescape function.

Use Firefox addon called REST Client with the above URL. Add a request header Name=Accept, Value=application/rssxml to see the returned data yourself.

发布评论

评论列表(0)

  1. 暂无评论