0
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 generates errors in the console, for example:
http://localhost/user/Lucas/test/images/history.png Failed to load Resource: the server responded with a status of 404 (Not Found)
How to prevent this?
are you sure your url ta is correct? It doesn’t make much sense to have an http inside another http, sometimes this is causing the error
– leofontes
Yes, Cors.io is because I can’t parse from my local machine, only on the server, when I’m in production I take that Cors.io, the script works normal, but the error is displayed on the console. Got it?
– sistematico
@leofontes looks at the code working: http://i.imgur.com/Ophr7ln.png
– sistematico