jQuery deferreds and promises – .then() vs .done()
The callbacks attached to done() will be fired when the deferred is resolved. The callbacks attached to fail() will be fired when the deferred is rejected. Prior to jQuery 1.8, then() was just syntactic sugar: promise.then( doneCallback, failCallback ) // was equivalent to promise.done( doneCallback ).fail( failCallback ) As of 1.8, then() is an alias … Read more