I am doing a data import using php (Laravel), which has 4-5 different statges.
So, I want to list all of them and the status of each product whether it was an insert or update.
Is there is a way in ajax, where I can fetch the string returned from the server immediately it was echoed line by line? And not at once after everything is completed?
Like
Starting ...
Copying Files ...
Executing ...
Product 1 ...
Product 2 ...
finished ...
$.ajax({
url: "product-import.php",
type: 'POST',
data: new FormData(this),
dataType:'text',
contentType: false,
cache: false,
processData: false,
success: function (data) {
console.log(data);
$('#importStatus').append(data);
}
});