Latest web development tutorials

jQuery deferred.notifyWith () method

jQuery Misc Methods jQuery Misc Methods


Definition and Usage

deferred.notify () function is used in a given context and parameters of the call being delayed callbacks on objects (progressCallbacks).

Note: 1. Typically, only the lingering objects (Deferred) creator to call this method.
2. You can return to a limited Promise object by calling deferred.promise (), to prevent other code changes delayed state of the object or report its status.
3. When deferred.notifyWith is called, you can access any progressCallbacks add deferred.then or deferred.progress. According to their order of execution callbacks are added. ) Passing parameters by .notifyWith (to each callback function, when the delay object has been resolved or rejected later, and then call any .notifyWith () (or add progressCallbacks) will be ignored.


grammar

deferred.notifyWith( context [, args ] )

参数 描述
context Object类型 作为this对象传递给进行中的回调
args Object类型 可选参数,传递给进行中的回调


jQuery Misc Methods jQuery Misc Methods