Latest web development tutorials

jQuery deferred.rejectWith () method

jQuery Misc Methods jQuery Misc Methods


Definition and Usage

deferred.rejectWith () function is used to reject delay object and call any failCallbacks callback function according to the given context and args parameters.


Note: 1. The delay is usually only object creator can call the method. You can call deferred.promise (), returns a limited Promise objects to prevent other code changes delayed state of the object or report its status.
2. When the delay object is rejected, any or deferred.fail by deferred.then added failCallbacks, will be called. The callback function in the order they are added to the execution. Passed to deferred.reject () of the args parameter will be passed to each callback function. When the object enters a delay state rejected any failCallbacks is added, it will be executed immediately, and bring to pass .reject () parameters.


grammar

deferred.rejectWith( context [, args ] )

参数 描述
context Object类型 作为 this对象传递给失败回调函数(failCallbacks )
args Array类型 传递一个可选的参数数组给失败回调函数(failCallbacks )


jQuery Misc Methods jQuery Misc Methods