So i have a js function that connects to a live data stream, converts it to json, and writes the json to an html page that is used in another process. it is working as expected, but only the last line of the json is being written to the page. I know it has to be something silly that i'm overlooking, but below is the code to write it to the pages
function displayFeed(feed) {
if (feed.data !== undefined && feed.data.length > 0) {
for (var i = 0; i < feed.data.length; i++) {
var row = null,
feedData = feed.data[i];
var a = JSON.stringify(feedData);
document.getElementById('mydiv').innerHTML = a;
console.log(feedData);
}
}
}
now, in the console output there are many lines written and updated, but in the div, only the last. does anyone see what I need to do to get all of the feed written to the html page? this data would be updated pretty frequently.
Any help would be appreciated