The Deferred objec

来源:互联网 发布:山西大学教务网络 编辑:程序博客网 时间:2024/04/30 10:45

http://api.jquery.com/category/deferred-object/

The Deferred object, introduced in jQuery 1.5, is a chainable utility object created by calling the jQuery.Deferred() method. It can register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function.

The Deferred object is chainable, similar to the way a jQuery object is chainable, but it has its own methods. After creating a Deferred object, you can use any of the methods below by either chaining directly from the object creation or saving the object in a variable and invoking one or more methods on that variable.

deferred.done()

http://api.jquery.com/deferred.done/

Description: Add handlers to be called when the Deferred object is resolved