jQuery-HTML:显示二合一

jQuery-HTML: Display Two multiple feeds into one

因此,我试图合并两个提要,并按时间将其显示在两列中,从左上角开始显示最新信息,从右下角显示最旧信息。准确地说,这是我想要的顺序:

------------------------
Newest     | 4th Newest
2nd Newest | 5th Newest
3rd Newest | 6th Newest 
------------------------

问题是,下面的代码没有运行,返回了一个错误

Uncaught TypeError: item is not a function  (index:329)

我使用的代码如下。

<script>
  $(document).ready(function() {
    var blogFeed = $.ajax({
      type: "GET",
      url: "http://www.foxinflame.tk/blog/feed",
      dataType: "xml"
    })
    var videoFeed = $.ajax({
      type: "GET",
      url: "/videoFeed.php",
      dataType: "xml"
    })
    $.when(blogFeed, videoFeed).done(function(blogXML, videoXML){
//The one below this one is the 329 line
      var combinedXML = $(blogXML).find("item").concat(videoXML.find("entry"));
      var sortedXML = combinedXML.sort(function(videoFeedCompare, blogFeedCompare){
        var videoFeedDate = Date.parse(videoFeedCompare.find("published"));
        var blogFeedDate = Date.parse(blogFeedCompare.find("pubDate"));
        return videoFeedDate - blogFeedDate;
      });
      console.log(sortedXML.item(0));
      sortedXML.forEach(function(eachCounter) {
        console.log("stuff");
        var title = $(this).find("title").text();
        console.log(title);
        var description = $(this).find("description").text();
        var comments = +($(this).find("slash:comments").text());
        var pubDate = $(this).find("pubDate").text();
        var link = $(this).find("link").text();
        if(eachCounter < 3){
                  $("#firstColumnOfItems").append("<div class='postCollection'><div class='z-depth-1 blogpost' style='min-height: 300px'><br><h5><a style='color:black' href='"+link+"'>"+title+"</a></h5><br><p>"+description+"<br><i>"+comments+" Comments. Published at "+pubDate+"</i></p></div></div>");
                } else if(eachCounter < 6) {
                  $("#secondColumnOfItems").append("<div class='postCollection'><div class='z-depth-1 blogpost' style='min-height: 300px'><br><h5><a style='color:black' href='"+link+"'>"+title+"</a></h5><p>"+description+"<br><i>"+comments+" Comments. Published at "+pubDate+"</i></p></div></div>");
                }
      });
    });
  })
</script>

请注意,VideoFeed.php 只是执行 file_get_contents 并回显它,因为 JS 无法执行此操作(没有访问控制允许来源 header 存在)。

出了什么问题,我该如何解决?

console.log(sortedXML.item(0)); 更改为 console.log(sortedXML.item[0]);