JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
cat 1
<div id="result" class="vidfeed" data-reg='cat 1' data-max="5"></div>
<br/>
cat 2<br/>
<div id="result" class="vidfeed" data-reg='cat 2' data-cat='3' data-max="5">K</div>
JavaScript
$('.vidfeed').each(function() {
var htmlString = "";
var $this = $(this);
var category = $this.data("reg");
var max = $this.data("max");
$.ajax({
url: "https://allfacccsdmds.blogspot.com/feeds/posts/default/-/"+category+"?max-results="+max+"&alt=json-in-script",
type: "get",
dataType: "jsonp",
success: $.each(function(e) {
//https://allfacccsdmds.blogspot.com/feeds/posts/summary?orderby=published&max-results=5&alt=json-in-script&callback=mycallback
var htmlCode = '<ul>';
for (var i = 0; i < 5; i++){
var labels = []; // collect labels here
for(var j = 0; j < e.feed.entry[i].category.length; j++){
labels.push(e.feed.entry[i].category[j].term); // append the label to the labels collection
}
var posttitle = e.feed.entry[i].title.$t;
var labels= labels.join(', ');
htmlString += '<b>title ='+posttitle+'</b><br/>' ;
htmlString += '<b>label type 1 (#) </b>'+labels +'<br/>' ;
htmlString += '<b>label type 2 (@)</b> '+labels +'<br/>' ;
htmlString += '<b>label type 3 (##) </b> '+labels +'<br/>' ;
$this.html(htmlString);
}}
)});});