In my project, after user input, an AJAX call is sent to the server, but the process might take some seconds to finish and it’s boring for users to wait for.
So I want to give response in two steps. first step will give back the more important data, and then the rest of process is done and finally the rest of data should be given back.
first I tried to make two ajax calls , but it makes some additional problems which makes it a bad idea.
Is this possible to give ajax response and update the page in two steps, or Is there some other type of technology to handle this job?
Thanks for your help
In the callback function of the first ajax request you start the second one.
Don’t start two in parallel, because only one gets executed at a time (in case you use sessions server side) and which one is first is more or less random.