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:
TestTestTest 1Test 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前端其它相关文章!