Can phpflush and ajax respond only once? $. ajax ({type: & nbsp; get, url: & nbsp ;. test. php, beforeSend: & nbsp; function (XMLHttpRequest) {console. log (start & nbsp; Send & nbsp;) ;}, can php flush and ajax respond only once?
$.ajax({
type: "get",
url: "./test.php",
beforeSend: function(XMLHttpRequest){
console.log("start Send ");
},
success: function(data, textStatus){
console.log("Success!");
},
complete: function(XMLHttpRequest, textStatus){
console.log("complete");
},
error: function(){
alert("Error");
}
});
Test. php
ob_start();
echo "First team";
ob_flush();
flush();
sleep(3);
echo "Follower";
ob_end_clean();
Do you want to return "First team" First? if you can, you can make progress bars.
------ Best solution --------------------
Ajax can be processed only when the data is fully accepted.
What you want, unless it is round-robin or long connections with html5
------ Other solutions --------------------
Reference:
Ajax can be processed only when the data is fully accepted.
What you want, unless it is round-robin or long connections with html5
Ah, that's a pity. asynchronous is all different. why ~
I guess it must be an unfortunate security issue or a mechanism restriction that is too difficult to implement ~
The three boxes have to be pulled three times. no matter how big your truck is, it's not environmentally friendly.
------ Other solutions --------------------
No.
However, if the returned results are incomplete, data is processed, and data integrity cannot be guaranteed.