Loop through node children in rss feed?

So I am not really sure how to do this and it seems pretty pretty trivial but I am getting an rss feed back and all I want to do is loop through a set of each elements that have children but I cannot seem to figure out how to get the values. My xml looks like this: Test Test Test 1 Test 1 My jquery looks like this: $(document).ready(function() { var FEED_URL = "myFeedUrl"; $.ajax({ url : FEED_URL, type : "GET", success : function(xml) { var item = $(xml).find('item').children(); $(item).children().each(function() { var title = $(item).children().find('title').text(); //do something }); } }); }); I am able to loop through it and get the 'item' element. But I want to loop through the children elements but I am not sure how to get the actual value! I thought I could do find such as: var title = $(item).children().find('title').text(); But that doesn't seem to work.

以上就是Loop through node children in rss feed?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准