Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can use the <a href="http://benalman.com/code/projects/jquery-message-queuing/docs/files/jquery-ba-jqmq-js.html" rel="nofollow noreferrer">jQuery Message Queueing</a> plugin. Put all the items you need to process, into a queue. Notice the <code>complete</code> function in the documentation:</p> <blockquote> <p><strong>complete</strong>: (Function) Called whenever there are no longer any queue items to process. After completion, if more queue items are added and the queue completes again, this function will be called again. Inside this function, <code>this</code> refers to the queueObj object.</p> </blockquote> <p>Put the code that you want to run inside that handler.</p> <p>One caveat though. I can't tell from the documentation if the <code>complete</code> handler is called after the callbacks have been executed for each AJAX request, or if it is immediately called when there are no items left to process in the queue (regardless of whether there are currently-executing AJAX requests). </p> <p><strong>UPDATE</strong></p> <p>I seem to have ignored the <code>callback</code> function:</p> <blockquote> <p><strong>callback</strong>: (Function) Called for each queue item or batch of items, every delay milliseconds. This function is passed a single argument, which is the single queue item if batch is 1, or an array of queue items if batch is > 1. If callback returns true, the queue item(s) will be re- added back onto the front of the queue for the next callback execution to retry. Inside this function, <code>this</code> refers to the queueObj object.</p> </blockquote> <p>I imagine that you can put everything you need to send into a batch and put the code that you need to run inside the <code>callback</code> handler.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload