AjaxQ jQuery Plugin
The first component that's being released as open source by Foliotek is the AjaxQ jQuery Plugin. The purpose of this plugin is for managing sequential ajax requests.
It is designed to follow the $.ajax, $.get, and $.post interfaces and return values, only taking one extra parameter (the queue name). Here is a brief sample of the functionality:
$.ajaxq ("MyQueue", {
url: 'http://jsfiddle.net/echo/jsonp/',
type: 'post',
dataType: "jsonp"
});
$.postq ("MyQueue", 'path/to/your/resource', onsuccess);
$.getq ("MyQueue", 'path/to/another/resource', onsuccess);
In this case, each request would only run once the other finished. See the AjaxQ demo to see it in action with multiple queues.
All the source code is available on Github, available under the MIT License. I hope to have more projects to report on in the future!
May 15th, 2012 at 5:25 pm
nulledscripts…
[…]AjaxQ jQuery Plugin – Brian Grinstead[…]…