I have the following code on my site.
setInterval(function(){
var id = $("#id_radio").val();
var id_glob;
$.ajax({
type: "POST",
url: "ajax/update_radio.php",
data: "id="+id,
success:function(e){
$("#nome_radio").removeClass("ellipsis");
$("#hora_radio").removeClass("ellipsis");
if(e!==""){
var expl = e.split(",");
var id_glob = expl[3];
if(expl[3] !== id){
$("#img_radio").animate({
opacity: 0
}, 300);
setTimeout(function(){
$("#img_radio").attr("src", "radio/programas/"+expl[3]+"/"+expl[0]);
$("#img_radio").css("width", "100%");
}, 300)
setTimeout(function(){
$("#img_radio").animate({
opacity: 1
}, 300);
}, 300)
$("#nome_radio").html(expl[1]);
$(".programa_radio").html(expl[1]);
$(".horario_radio").html(expl[2]);
$("#hora_radio").html(expl[2]);
$("#id_radio").val(expl[3]);
$("#pub_radio").animate({
opacity: 0
}, 300);
setTimeout(function(){
$("#pub_radio").attr("src", "adm/images/publicidades/"+expl[5]+"/"+expl[6]);
$("#pub_radio").css("max-width", "100%");
}, 300)
setTimeout(function(){
$("#pub_radio").animate({
opacity: 1
}, 300);
}, 300)
$.ajax({
type: "POST",
url: "ajax/update_pub_radio.php",
data: "id="+$("#id_radio").val(),
success: function(t){
$(".carousel_imgs").animate({
opacity: 0
}, 300);
setTimeout(function(){
$(".carousel_imgs").html(t);
}, 300)
setTimeout(function(){
$(".carousel_imgs").animate({
opacity: 1
}, 300);
}, 300)
}
})
}
}
}
});
}, 1000);
With this code it every second updates the current program of the radio but a little bit begins to appear a bug in the console (403 Forbidden). I have the exact same code on another website and it works perfectly.
And besides giving 403 error on the console, the whole site gets 403 forbidden until after a few seconds.
I have something wrong?