Skip to content

Instantly share code, notes, and snippets.

@pkriete
Created June 17, 2009 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkriete/131493 to your computer and use it in GitHub Desktop.
Save pkriete/131493 to your computer and use it in GitHub Desktop.
jQuery 1.3 compatible version of the ajax queue plugin.
/**
* Ajax Queue Plugin
*
* Original Homepage: http://jquery.com/plugins/project/ajaxqueue
* Original Documentation: http://docs.jquery.com/AjaxQueue
*/
jQuery.ajaxQueue = function(o){
var _old = o.complete;
o.complete = function(){
if ( _old ) _old.apply( this, arguments );
jQuery([ jQuery.ajaxQueue ]).dequeue( "ajax" );
};
jQuery([ jQuery.ajaxQueue ]).queue("ajax", function(){
jQuery.ajax( o );
});
if ( jQuery([ jQuery.ajaxQueue ]).queue("ajax").length == 1 ) {
jQuery([ jQuery.ajaxQueue ]).dequeue("ajax");
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment