I have an Ajax call that updates 5,000 records in a database so this takes a lot of time. I have an Ajax \"Loading image\" showing that something is happening, but I am loo
For showing progress during load, I would modify my backend so that it can do selective loading.
For example,
var total_rec = 5000;
var load_steps = 20;
var per_load = total_rev / load_steps;
var loaded = 0;
while (loaded < total_rec) {
www.foobar.com/api.php?start=loaded&end=(loaded+per_load);
loaded += per_load;
}
Every time the load is done, update the progress bar.
An alternative way to modify the backend can be
www.foobar.com/api.php?start=loaded&count=50