AJAX Queue/Synch/Abort/Block Manager

Helps you to manage AJAX requests and responses (i.e. abort requests, block requests, order responses). It is inspired by the AJAX Queue Plugin and the AjaxQueue document in the jQuery-Wiki.

$.manageAjax

Creates a new $.ajaxManager and returns it. Takes a list of options:

Your constructed ajaxmanager knows two methods:

Example:

var ajaxManager1 = $.manageAjax({manageType: 'abortOld', maxReq: 0}); ajaxManager1.add({ success: function(html) { $('ul').append('<li>'+html+'</li>'); }, url: 'test.html' });

Demo:

Tip: Open your Firebug-Console, log the XHR´s and click around.

{manageType: 'sync', maxReq: 0}

0 secound delay | 1 secound delay | 2 secounds delay | 3 secounds delay |

{manageType: 'abortOld', maxReq: 0}

0 secound delay | 1 secound delay | 2 secounds delay | 3 secounds delay |

{maxReq: 2}

0 secound delay | 1 secound delay | 2 secounds delay | 3 secounds delay |

{manageType: 'abortOld', maxReq: 2, blockSameRequest: true}

0 secound delay | 1 secound delay | 2 secounds delay | 3 secounds delay |

{manageType: 'queue', maxReq: 2, blockSameRequest: true}

0 secound delay | 1 secound delay | 2 secounds delay | 3 secounds delay |

Download

Licenses

Back to protofunc