javascript - Parse RSS feed with multiple <link> (jquery) -


i'm using jquery parse , output 3 rss feeds 3 different container divs. first 2 feeds work fine, can't links work in third feed, href isn't found @ all. see fiddle http://jsfiddle.net/a68myvm2/1/

i'm thinking has third feed contains multiple link tags per item. i've tried searching web solution without success.

html

<div id="content_1"></div> <div id="content_2"></div> <div id="content_3"></div> 

js

    $(function () { function getfeeds(){ var urls = ['http://www.gosugamers.net/counterstrike/news/rss', 'http://www.hltv.org/news.rss.php', 'http://feeds.thescoreesports.com/csgo.rss']; urls.foreach(function(query){ $.ajax({   type: "get",   url: 'http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=1000&callback=?&q='+encodeuricomponent(query),   datatype: 'json',   error: function () {   alert('unable load feed, incorrect path or invalid feed');   },   success: function(xml) {  var content=parseint(urls.indexof(query))+1;     $("#content_"+content).html('');       $.each(xml.responsedata.feed.entries, function(idx, value){     $("#content_"+content).append('<a class="news-item" href="' + value.link + '" title="' + value.title +'" target="_blank"><p>' + value.publisheddate + '</p><h3>' + value.title + '</h3></a><hr>');       });   } }); }); } //call getfeeds every 5 seconds. setinterval(getfeeds,5000); //page ready, feeds. getfeeds(); }); 

part of problematic feed (http://feeds.thescoreesports.com/csgo.rss)

    <item>           <guid ispermalink="false">4117</guid>           <title>scrunk joins team coast coach</title>           <link>http://www.thescoreesports.com/news/4117</link>           <pubdate>wed, 30 sep 2015 18:02:45 +0000</pubdate>           <dc:creator/>           <media:content url="https://dqrt72khb0whk.cloudfront.net/uploads/image/file/2729/w1080xh810_coast.jpg?ts=1432916713">             <media:credit>team coast</media:credit>           </media:content>           <content:encoded>             <![cdata[<p>team coast have brought in german cs:go professional, robin &quot;<strong>scrunk</strong>&quot; r&ouml;pke, take reigns team&#39;s coach, organization announced wednesday. </p><figure><blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">we officially welcome <a href="https://twitter.com/cstscrunk">@cstscrunk</a> our new cs:go coach! please show support , give him follow!!</p>&mdash; team coast (@teamcoastgaming) <a href="https://twitter.com/teamcoastgaming/status/649268154590470144">september 30, 2015</a></blockquote>         <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></figure><p>&quot;i thank team coast , players giving me opportunity throw eu knowledge , style na scene,&quot; said scrunk in <a href="http://www.hltv.org/news/16051-scrunk-joins-team-coast-as-coach">statement hltv.org</a>. &quot;i excited see route in career leads me , can team go.&quot;</p><p>team coast competing in north american divisions of both cevo-p season 8 , esl esea pro league season 2. sit @ sixth in cevo-p division 2-4-3 record , third in esl esea pro league record of 3-4.</p><p><em>paul park wr​iter thescore esports. <a target="_blank" href="https://twitter.com/phjpark">you can follow him on twitter</a>.</em></p><p><small><em>copyright &copy; 2015 score media ventures inc. rights reserved. content reproduced under license.</em></small></p>]]>           </content:encoded>           <link rel="related" type="text/html" href="http://www.thescoreesports.com/news/4070" title="dead pixels cs:go part ways faris , youns"/>           <link rel="related" type="text/html" href="http://www.thescoreesports.com/news/4115" title="g2.kinguin add jkaem roster"/>           <link rel="related" type="text/html" href="http://www.thescoreesports.com/news/4102" title="esl esea pro league hot match of week 3"/>           <link rel="related" type="text/html" href="http://www.thescoreesports.com/news/4061" title="highlight: azr shuts down winterfox"/>           <link rel="related" type="text/html" href="http://www.thescoreesports.com/news/4063" title="dreamhack stockholm group b roundup: down , out"/>  </item> 


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -