jQuery deferred.pipe() 方法

jQuery 教程 · 2019-03-29 21:16:31

实例

过滤解决(resolve)值

$(function () { var defer = $.Deferred(), filtered = defer.pipe(function( value ) { return value * 2; }); defer.resolve( 5 ); filtered.done(function( value ) { alert( "值是 ( 2*5 = ) 10: " + value ); }); })

定义和用法

deferred.pipe() 函数用于过滤 and/or 链式延迟对象的工具方法。

注意:从jQuery 1.8开始, deferred.pipe() 方法过时。使用 deferred.then() 代替它。

语法

方法一

deferred.pipe( [doneFilter ] [, failFilter ] )

方法二

deferred.pipe( [doneFilter ] [, failFilter ] [, progressFilter ] )

参数 描述
doneFilter Function类型 可选函数,当延迟得到解决时调用
failFilter Function类型 可选函数,当延迟被拒绝时调用
progressFilter Function类型 可选函数,当进度通知发送给Deferred(延迟)被调用

点击查看所有 jQuery 教程 文章: https://www.codercto.com/courses/l/35.html

查看所有标签

Writing Apache Modules with Perl and C

Writing Apache Modules with Perl and C

Lincoln Stein、Doug MacEachern / O'Reilly Media, Inc. / 1999-03 / USD 39.95

Apache is the most popular Web server on the Internet because it is free, reliable, and extensible. The availability of the source code and the modular design of Apache makes it possible to extend Web......一起来看看 《Writing Apache Modules with Perl and C》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具