I have a web application, in which I’m making an AJAX call to fetch some data. The data can vary from a 100 Kb to 1 Mbs. Also, this call take a lot of time, since I need to do a lot of processing at the back-end.
I’m running into 2 basic issues:
1) It takes a lot of time, so I need to show some status of the AJAX call to the end-user, so that they don’t get frustrated. I was thinking if there was a way to make an AJAX call after some interval to check the progress of the initial AJAX call, or may be something you can suggest?
2) When the data is received, it sometimes even hangs the browser tab for like a minute or two, because I’m painting the page through JavaScript. Would there be a way to stop or reduce this hanging time?
Any advice would be really helpful. Thanks.
Okay, I got a way through. I was able to check the progress without actually painting any iFrame. I simply created a session variable and keep on updating its value at the server side. I set a timeout function to trigger every sec, and checked the session variable’s value by making an AJAX call. I know it’s creating some extra load on the server, but I don’t know any other way by now. Any more suggestions are welcomed.