$(function() { setInterval(function() { $.getJSON('/monitor/api/status/memory',function(data) { console.log("Response: " + data); if(data.mem != undefined) { $('.mem-rss').html(data.mem.rss); $('.mem-heap').html(data.mem.heapUsed + " / " + data.mem.heapTotal); } }); },2000); $.getJSON('/monitor/api/bundles',function(data) { $thead = $('table.bundle-list thead'); $thead.html(''); var add = ''; add+= ''; Object.keys(data[0]).forEach(function(v) { add+='' + v + ''; }); add +='' console.log("Adding: " + add); $thead.html(add); $tbody = $('table.bundle-list tbody'); $tbody.html(''); data.forEach(function(v) { add='' Object.keys(v).forEach(function(e) { add+=' ' + v[e] + ''; }); add+=''; $tbody.append(add); }); }); });