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
2 Answers
Reset to default 3The 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.