http://jsfiddle.net/Pd2cp/2/
as in the jsFiddle above you’ll see only one label is returned per post when there are many.
i am using the below jquery. how can i return ALL labels for EACH post. and just as reference i got alot of info from here
$.ajax({
url: 'http://www.blogger.com/feeds/2814965631975331659/posts/default?alt=json-in-script&max-results=8',
type: 'get',
dataType: "jsonp",
success: function(data){
for (var i = 0; i < data.feed.entry.length; i++){
var title = data.feed.entry[i].title.$t;
for(var j = 0; j < data.feed.entry[i].category.length; j++){
var categories = data.feed.entry[i].category[j].term;
}
$('#blogContainer').append(title+'<br/>'+categories+'<br/><br/>');
}
}
});
In your loop that goes through the categories, you were assigning the category values to the same variable
var category, where it gets overwritten in every loop. What you need to do is have acategoryarray that collects the category labels.Here’s the working code: