I got a server-side script that I call with jQuery ajax method. It can take quite a while for it to process data set. After each row of input data is processed, it prints out a "OK <row id>"
to output. The content type is plain/text
.
What I want is to get this output in my jquery function, parse it as it comes and display some kind of feedback information to the user. As it can take up to 20-30 minutes to process all the data...
How can I do this in jQuery (the server script prints this out alredy). If I use the code below, I get the success
function called after the script finishes its run.
$.ajax({
type: "POST",
url: "script.cgi",
data: data,
success: function() {
// do something
alert ("OK");
}
});