XHR serialized queue manager
JavaScript Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
build
src
.gitignore
LICENSE.txt
README.md
dlay.jquery.json

README.md

jQuery DLay Plugin

A jQuery plugin that adds XHR chaining ability.

DLay provides chaining wrappers for jQuery's AJAX methods and for XHR requests. Every request in the same queue becomes serialized. Progress and load events are available. Progress events report both active request progress and total queue size.

DLay supports serial (default) or parallel queues.

// Progress handler:
    $.dlay.progress('queue1', function ( e, queue_length ) {
        console.log( queue_length );
    });

// Load handler:
    $.dlay.load('queue1', function () {
        console.log('Queue1 finished loading!');
    });

// Serial/parallel queue:
    $.dlay.parallel('queue1');
    $.dlay.serial('queue1');


// GET with DLay:
    $.dlay.get('queue1', 'http://example.com', {}, function (data, textStatus, xhr) {}, 'json');

// POST with DLay:
    $.dlay.post('queue1', 'http://example.com', {}, function (data, textStatus, xhr) {}, 'json');

// XHR with DLay:
    var xhr = new XMLHttpRequest();
    xhr.open('GET', 'http://example.com', true);
    xhr.responseType = 'arraybuffer';
    xhr.onload = function (e) {};
    $.dlay.xhr('queue1', xhr);