I have the following code:
<table class="table" id="historico">
<thead>
<tr>
<th>Hora</th>
<th>Música</th>
</tr>
</thead>
<tbody></tbody>
</table>
And the script:
setInterval(function() {
$.ajax({
url: 'http://cors.io/?http://somdomato.com:8000/played',
type:'GET',
success: function(retorno){
var html = "";
$("<table>").html(retorno).find('tr').slice(3).each(function () {
var arrayColuna = [];
$(this).find('td').each(function () {
arrayColuna.push("<td>" + $(this).text() + "</td>");
});
html += "<tr>" + arrayColuna.slice(0,2) + "</tr>";
});
$("#historico > tbody").html(html);
}
});
}, 10000);
Only this causes errors in the console, for example:
link Failed to load resource: the server responded with a status of 404 (Not Found)
How to avoid this?