deferred.catch( failFilter )返回: Promise
描述: 添加当 Deferred 对象被拒绝时要调用的处理程序。
-
版本添加于: 3.0deferred.catch( failFilter )
-
failFilter类型:Function()当 Deferred 被拒绝时调用的函数。
-
deferred.catch( fn ) 是 deferred.then( null, fn ) 的别名。请阅读其页面以获取更多信息。
示例
由于 jQuery.get 方法返回一个 jqXHR 对象,该对象派生自一个 Deferred 对象,因此我们可以使用 .catch 方法添加拒绝处理程序。
|
1
2
3
4
5
6
7
|
|