0
Galley,
I have a page in PHP that makes a query in the database at the end of the processing I show the amount of records updated. This process takes a while, in my Jquery I only show the total of affected records, how could I change my Jquery to show time to time, in case every 1 second it shows the user the amount of records.
EDIT: ATTENTION I can not keep calling the PHP page several times, I need to call a single time and listen to her or receiving data from her!
var form_data = new FormData();
form_data.append('id', idSel);
$.ajax({
url: 'postar_reenvio.php', // caminho para o script que vai processar os dados
type: 'POST',
data: form_data,
cache: false,
contentType: false,
processData: false,
beforeSend: function () {
$('.resp').html("<img src='images/spin.gif' alt='Notificação' height='70' width='70'/> <br>Enviando Mensagens, aguarde!");
},
success: function(response) {
Creates a function that makes this control. And
success
use thesetTimeout
to set the time to call this function again– Don't Panic
In my PHP page I only use echo($cont); I wanted to put an echo inside the Loop I have on the PHP page and every 1 second and reply to Jquery
– William
Possible duplicate of Jquery/Ajax - How to keep the page up to date?
– abfurlan
@abfurlan It is not equal pq the question that you posted it keeps calling the function "site" I do not want to call the function again, I want to get the data from the PHP page.
– William