Sorry to ask but need some help. I'm using the below script shown to parse an RSS feed of blog entries. In this example, I'm using "Mashable" feed as the feed source to demonstrate.
Issue:
The blog entry images and links appear correctly. But the problem is, I'd like to also include the blog entry titles for output as well, and not sure how to write it.
Can anyone take a look and offer a suggestion as to how I might include the entry title (+ link) in the below script if possible?
I'd be grateful for any suggestions or help. Thank you.
Script:
$parseRSS({
url: "http://feeds.mashable.com/Mashable?format=xml",
count: 16,
callback: function(posts) {
for(var i = 0; i < posts.length; i++) {
var img = posts[i].content.split('src="')[1].split('"')[0];
var link = posts[i].link;
document.body.innerHTML += '<a href="' + link + '"><img src="' + img + '"></a>';
}
} });
posts
array contains also titles, so you just need to append them to the document body:codepen