I have a form with a specific action. When the form is submitted, I submit an ajax call that invokes this action. On the other hand, I am sending another ajax call to update progress. I did it as follows:
$("form").submit(function() { function callBack() { if( (this.readyState == 4) && (this.status == 200) ) { console.log(this.responseText); } } function updateProgress (){ asyncReq('/get_progress?progress='+progress, callBack); } function asyncReq(url, functionCallBack) { var request;
I have 2 asynchronous javascript calls, one for submitting a form and one for updating progress. When I type responseText in callBack , I can only see 0.0 and 1.0. This is before ajaxSubmit() is called and after it completes. I would like to get all the value of progress in the middle as well. As far as I understand, the second ajax call for asyncReq is called only after ajaxSubmit completed. Can someone give me an idea of ββhow I make another full ajax call before ajaxSubmit() ?
Note:
The form consists of a file field and ajaxSubmit unzips, processes the file and updates the execution table after processing each file. The get_progress method retrieves the progress value of this table. I am using jquery.form.js to submit a form by ajax call.
source share