A simple queue for your ajax requests in jQuery.
Clone or download
Latest commit c996acb Jul 3, 2015
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist Updating dist/ folder from last merge Mar 19, 2013
src Fix bug in abort functionality. We stored the deferred object instead… Feb 22, 2013
test Added core ajaxQueue qunit tests Oct 29, 2013
.gitignore ajaxQueue initial commit Jan 16, 2013
.jshintrc Bump npm dependencies Oct 29, 2013
Gruntfile.js Use author from package.json for manifest Jan 16, 2013
LICENSE-MIT ajaxQueue initial commit Jan 16, 2013
ajaxQueue.jquery.json Use author from package.json for manifest Jan 16, 2013


jQuery Ajax Queue

Which files to use?

The release version of the code is found in the dist/ directory.

In your web page:

<script src="jquery.js"></script>
<script src="dist/jquery.ajaxQueue.min.js"></script>
	url: "/ajax",
	dataType: "json"
}).done(function( data ) {
	// ...


This pluging creates a new method which ensures only one AJAX request is running at a time. It waits for the previous request(s) to finish before starting a new one using jQuery's built in queue.

jQuery.ajaxQueue( options )

Takes the same options as jQuery.ajax, and returns a promise. The return value is not a jqXHR, but it will behave like one. The abort() method on the returned object will remove the request from the queue if it has not begun, or pass it along to the jqXHR's abort method once the request begins.


(Coming soon)

Release History


Copyright (c) 2013 Corey Frang
Licensed under the MIT license.


In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Important notes

Please don't edit files in the dist subdirectory as they are generated via grunt. You'll find source code in the src subdirectory!

While grunt can run the included unit tests via PhantomJS, this shouldn't be considered a substitute for the real thing. Please be sure to test the test/*.html unit test file(s) in actual browsers.

Installing grunt

This assumes you have node.js and npm installed already.

  1. Test that grunt is installed globally by running grunt --version at the command-line.
  2. If grunt isn't installed globally, run npm install -g grunt to install the latest version. You may need to run sudo npm install -g grunt.
  3. From the root directory of this project, run npm install to install the project's dependencies.

Installing PhantomJS

In order for the qunit task to work properly, PhantomJS must be installed and in the system PATH (if you can run "phantomjs" at the command line, this task should work).

Unfortunately, PhantomJS cannot be installed automatically via npm or grunt, so you need to install it yourself. There are a number of ways to install PhantomJS.

Note that the phantomjs executable needs to be in the system PATH for grunt to see it.