Ciao a tutti,
Qual'è il modo migliore per chiamare ciclicamente una richiesta ajax. Dovrei inviare molte mail e per questo vorrei "spezzare" l'invio in blocchi. Per adesso faccio così:
codice:
function sendRequest(id, table, page){
$.ajax({
type: "GET",
url: "do.php?action=sendblock&table=" + table + "&id=" + id + "&page=" + page,
dataType:"json"}).done(function(response){
if(response.status == "ok"){
_data.mailSend += response.send;
$.each(response.mailError, function(index, mail){
_data.error.push(mail);
});
showProgress();
if(response.continue == 1){
sendRequest(id, table, response.nextpage);
}
}else{
$("#info").html(response.error);
}
});
}
E' corretto? ho ci potrebbero essere dei problemi
Grazie