我从rss feed url获取数据,它采用以下格式
<item><title>NY Fashion Week Series - Christy Turlington - The Model As Muse</title>
<category>Art</category><category>Obsessions</category>
<dc:creator>Maria Brito</dc:creator><pubDate>Mon, 09 Sep 2013 04:15:23 +0000</pubDate>
<link>http://outtherenyc.com/blog/2013/9/7/ny-fashion-week-series-christy-turlington-
the-model-as-muse-becoming-art</link>
<description>
<![CDATA[<img data-image-focal-point="0.5,0.5" data-image-dimensions="2277x2448
src="http://static.squarespace.com/static/516856a2e4b0f7270653d39d
/t/522b5766e4b04879e6b56512
/1378572144913MariaBrito_Christy_Turlington.JPG?format=500w"
/>
<img data-image-id="522b7cbbe4b0832d81b4fefe" data-image-focal-point="0.5,0.5"
data-image-dimensions="489x693" alt="First Eternity campaign shot by Bruce Weber in
1989" data-load="false" src="http://static.squarespace.com/static
/516856a2e4b0f7270653d39d/522b7cabe4b0d7cf73eb08f5/522b7cbbe4b0832d81b4fefe
/1378582251145/Christy-Eternity.jpg?format=500w" />
]]></description></item>
有多个图像。我想只有第一张图片。我已经解析了标题和网址。但是在图像的情况下它显示为空。我使用以下代码。
<script type="text/javascript">
$(document).ready(function() {
$.get("http://outtherenyc.com/blog?format=rss", function (data) {
var resultsA="";
var i;
$(data).find('item').each(function(i){
alert(i);
var container2 = $(this).find('description').text().replace('<![CDATA[','');
var title = $(this).find('title').text();
var url = $(this).find('link').text();
var img_url = $('img', container2).attr('src');
if(i>2 && i<=5){
alert(img_url);
resultsA += '<a href="'+url+'" target="_blank" ><div class="title"><b>'+title+'</b>
</a></div>';
}
});
$('#Getfeed').html(resultsA);
});
});
</script>
<div id="Getfeed"></div>
请告诉我如何解析第一张图片网址?