Javascript 使用多个<;链接>;(jquery)

Javascript 使用多个<;链接>;(jquery),javascript,jquery,rss,Javascript,Jquery,Rss,我使用jQuery解析三个RSS提要并将其输出到三个不同的容器div中。前两个提要工作正常,但我无法在第三个提要中获得链接,href根本找不到。看小提琴 我认为这与第三个提要包含每个项目的多个链接标记有关。我尝试在网上搜索解决方案,但没有成功 HTML JS $(函数(){ 函数GetFeeds(){ var url=['http://www.gosugamers.net/counterstrike/news/rss', 'http://www.hltv.org/news.rss.php',

我使用jQuery解析三个RSS提要并将其输出到三个不同的容器div中。前两个提要工作正常,但我无法在第三个提要中获得链接,href根本找不到。看小提琴

我认为这与第三个提要包含每个项目的多个链接标记有关。我尝试在网上搜索解决方案,但没有成功

HTML


JS

$(函数(){
函数GetFeeds(){
var url=['http://www.gosugamers.net/counterstrike/news/rss', 'http://www.hltv.org/news.rss.php', 'http://feeds.thescoreesports.com/csgo.rss'];
forEach(函数(查询){
$.ajax({
键入:“获取”,
网址:'http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=1000&callback=?&q=“+encodeURIComponent(查询),
数据类型:“json”,
错误:函数(){
警报(“无法加载提要、路径不正确或提要无效”);
},
成功:函数(xml){
var Content=parseInt(url.indexOf(Query))+1;
$(“#content"+content).html(“”);
$.each(xml.responseData.feed.entries,函数(idx,值){
$(“#content”+content).append(“
”); }); } }); }); } //每5秒调用一次GetFeeds。 设置间隔(GetFeeds,5000); //页面已准备好,获取提要。 GetFeeds(); });
问题源的一部分()


4117
ScrunK加入海岸队担任教练
http://www.thescoreesports.com/news/4117
2015年9月30日星期三18:02:45+0000
海岸队
海岸队引进了德国CS:GO professional,Robin“ScrunK”Rö;pke,以国王为队';该组织于周三宣布,这是一位美国教练

我们正式欢迎您成为我们的新CS:GO教练!请表示您的支持,并给他一个后续

&mdash;团队海岸(@TeamCoastGaming) “我要感谢海岸队和球员们给了我这个机会,让我把我的欧盟知识和风格融入NA的舞台,”ScrunK在他的演讲中说。“我很高兴看到我职业生涯中的这条路线指引了我,我可以帮助这支球队走向何方。”

海岸队目前正在CEVO-p第8季和ESL ESEA职业联赛第2季的北美赛区比赛。他们目前在CEVO-P赛区以2-4-3的战绩排名第六,在ESL ESEA职业联赛中以3-4的战绩排名第三。

​国际核聚变实验堆电子竞技

版权与复制;2015 Score Media Ventures Inc.版权所有。根据许可证复制的某些内容。

]>
如果谷歌没有设置它,你就不能使用它,但在我看来,你可以手动创建第一个链接的url,concat为
”http://www.thescoreesports.com/news/“
guid
值。很好。不幸的是,
+value.guid+
由于某些原因返回“undefined”。。。
<div id="content_1"></div>
<div id="content_2"></div>
<div id="content_3"></div>
    $(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 to 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 is ready, get feeds.
GetFeeds();
});
    <item>
          <guid isPermaLink="false">4117</guid>
          <title>ScrunK joins Team Coast as 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, to take the reigns as the team&#39;s coach, the organization announced Wednesday. </p><figure><blockquote class="twitter-tweet" lang="en"><p lang="en" dir="ltr">We would like to officially welcome <a href="https://twitter.com/CSTScrunK">@CSTScrunK</a> as our new CS:GO coach! Please show your support and give him a 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 would like to thank Team Coast and the players for giving me this opportunity to throw my EU knowledge and style into the NA scene,&quot; said ScrunK in his <a href="http://www.hltv.org/news/16051-scrunk-joins-team-coast-as-coach">statement to HLTV.org</a>. &quot;I am excited to see where this route in my career leads me and where I can help this team go.&quot;</p><p>Team Coast are currently competing in the North American divisions of both CEVO-P Season 8 and ESL ESEA Pro League Season 2. They currently sit at sixth in the CEVO-P division with a 2-4-3 record and third in the ESL ESEA Pro League with a record of 3-4.</p><p><em>Paul Park is a wr​iter for 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. All rights reserved. Certain 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 with FARIS and YOUNS"/>
          <link rel="related" type="text/html" href="http://www.thescoreesports.com/news/4115" title="G2.Kinguin add jkaem to 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 and out"/>
 </item>