I am a front-end web designer. I tried to create a web app with Rss from a site but don't get images only the news titles. I want the image associated with a news title to appear beside the title instead of the Rss logo.
Thanks.
Printable View
I am a front-end web designer. I tried to create a web app with Rss from a site but don't get images only the news titles. I want the image associated with a news title to appear beside the title instead of the Rss logo.
Thanks.
Hi,
If you have created the Web app using RSS Feed project wizard in SDK, you can modify jQuery.jfeed.js file to find images.
By default script checks link or media elements in feed against common image content types and uses first one it finds.
(Check code around rows 168 and 251).
In your case, images might be in HTML tags in feed content, not in separate elements in feed.
You can try following code to search for IMG tags in HTML formatted post content.
[CODE]
var images = jQuery(this).find('img');
if(images.length > 0){
item.image = {
width: '75',
height: '50',
url : images.eq(0).attr('src')
};
}
[/CODE]
Br,
Ilkka