, backend script. , , . , , " ". , , php ( ) script .
php - :
while($response !== 'I'm done'){
sleep(1);
}else{
return $some_value;
exit();
}
script . sleep (1) script 1 , . . php script .
, , . , abort script. - , script. , javascript.
In the tests that I did. I made the initial ajax call, and when the value was returned, I made another ajax call so that your back end of the script will not time out. I only talked to this on my local server, so I'm not sure how this is the real world, but it works.
source
share