Answer the question
In order to leave comments, you need to log in
How to update data on a page?
socket.on('ten', function(msg) {
for (var i = 0; i < msg.data.length; i++) {
$("table").append("<tr><td>"+msg.data[i]+"</td></tr>");
}
});
<table id="log1"></table>
Answer the question
In order to leave comments, you need to log in
socket.on('ten', function(msg) {
$("table").html('');
msg.data.forEach(item => $("table").append(`<tr><td>${item}</td></tr>`));
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question