javascript - entry.description; not working with jGFeed -
i using jgfeed parse rss feed, code below:
$.jgfeed('http://feeds.bbci.co.uk/news/rss.xml', function(feeds){ // check errors if(!feeds){ // there error return false; } // whatever want feeds here $('#newstimeline').empty(); for(var i=0; i<feeds.entries.length; i++){ var entry = feeds.entries[i]; var title = entry.title; var description = entry.description; var linkurl = entry.link_url; var date = getdate(entry.pubdate); var time = gettime(entry.pubdate); $('#newstimeline').append('<li><time class="cbp_tmtime" datetime="'+date+' '+time+'"><span>'+date+'</span> <span>'+time+'</span></time><div class="cbp_tmicon cbp_tmicon-phone"></div><div class="cbp_tmlabel"><h2>'+title+'</h2><p>'+description+'</p></div></li>'); } }, 10);
the problem is working entry.title, nothing after works:
note: no errors logged in javascript console.
try
for(var i=0;i<feeds.entries.length;i++){ var entry = feeds.entries[i]; var title = entry.title; var linkurl= entry.link; var description = entry.contentsnippet; var date = entry.publisheddate; $('#newstimeline').append('<li><time class="cbp_tmtime" datetime="'+date+' '+time+'"><span>'+date+'</span> <span>'+time+'</span></time><div class="cbp_tmicon cbp_tmicon-phone"></div><div class="cbp_tmlabel"><h2>'+title+'</h2><p>'+description+'</p></div></li>'); }
Comments
Post a Comment