queue - Queuing jQuery $.each iterations -
i'm guessing should simple, can't life of me find out how it.
i have each loop, runs through number of products, , runs function against each of them. function, amongst other things, updates table product's information. however, need wait until 'runthisfunction()' completes, before moving on next product, , running function again.
for example;
$.each(data.products, function(id, v) { runthisfunction(v); });
inside runthisfunction(), pulls information product localstorage database, because runs quickly, moves on next product before it's done needs do. add delay, don't want purposely slow down.
i know should simple...
have @ queue()
function of jquery. http://api.jquery.com/queue/
another useful source: what queues in jquery?
Comments
Post a Comment