Say that we have an Ajax call. This for just an example:
function delete_mov(id){
$.ajax("delete_mov.php?id="+id
)
.success(function(){
$('#message').("Movimento "+id+" correttamente cancellato");
})
.fail(function(){
$('#message').("Problemi a cancellare il movimento "+id);
});
}
It will do its job as expected. Say that the PHP behind will take some time to be executed and that the php code sends some messages when it will complete a step of the execution. For example:
<?php
//do first part of code
echo "First step completed";
//do second part of code
echo "Second step completed;
//do third part of code;
echo "Third step completed;
//do last part of code
//send success message back to Ajax
?>
What I'd like to do is to receive back from the ajax call each message when it is echoed by PHP so that the message div will be updated with each message one after the other. Is it feasible? Is it possible to send some messages between request and response?