Reputation: 3132
This is a snippet of the xml file from an RSS feed
<item>
<title>creamy whites</title>
<description><p><a href="/pin/201606520789168653/"><img
src="http://media-cache.pinterest.com/upload/229261437250994034_0HxSxJNv_b.jpg"
></a></p><p>creamy whites</p></description>
</item>
Now this is the code that is already in the ZRRSfeed:
// Add feed row
html += '<li class="rssRow '+row+'">' +
'<'+ options.titletag +'><a href="'+ entry.link +'" title="'+
feeds.title +'" target="'+ options.linktarget +'">'
+ entry.description +'</a></'+
options.titletag +'>'
Now instead of getting the entry.decription
I would like to get the src
value that is within the entry.decription
I have tried:
entry.decription[src]
, entry.decription[src].val()
, entry.decription->src
entry.decription.attr(src)
, entry.decription.getAtrribute("src")
(i might have mis-typed any of this code here - but when I tried them I did check in google for things like 'getAttribute') and none of them worked.
Upvotes: 0
Views: 515
Reputation: 43
try this one..
var src = $('entry.description')find('img').attr('src');
console.log(src); // debug using console firebug in firefox
//or developer tools in chrome
//the output should be the url of img
then replace entry.description that lies within anchor tag with src.
Upvotes: 1