Plugins

The plugins site is currently in development.

We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.

Enhancing of jQuery.ajax with JSDeferred


Enhancing of jQuery.ajax with JSDeferred

Example

$.getJSON('/foo').next(function(foo) {
  console.log('next', foo);
  return $.getJSON('/bar').next(function(bar) {
    console.log('bar', bar);
    return [foo, bar];
  });
}).next(function(foobar) {
   console.log('foobar', foobar[0], foobar[1]);
}).post('/foo', { foo: 'bar' }).next(function() {
}).error(function(status) {
   console.log('error', status);
});

Methods

The jQuery.ajax short cut was changed. jQuery.ajax returns the Deferred object.

The following method was added.

jQuery.wait
jQuery.next
jQuery.call
Deferred.next
Deferred.error
Deferred.call
Deferred.fail
Deferred.cancel
Deferred.wait
Deferred.next
Deferred.call
Deferred.ajax
Deferred.get
Deferred.getJSON
Deferred.post

Downloads



0
Your rating: None