赞
踩
- function f1(callback){
- setTimeout(function(){
- //f1的代码
- callback();
- },1000)
- }
- f1(f2);
- f1.on("done".f2);
- function f1(){
- setTimeout(function(){
- //f1的代码量
- f1.trigger("done");
- },1000)
- }
- jQuery.subscribe("done",f2);
- function f1(){
- setTimeout(function(){
- //f1的代码
- jQuery.publish("done");
- },1000)
- }
f1().then(f2).then(f3);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。