jquery ajax监听 then when done
来源:互联网 发布:7z解压软件 linux 编辑:程序博客网 时间:2024/05/17 02:57
JQuery的Promise详解(一):Promise基础 http://www.ido321.com/1643.html
jQuery的deferred对象详解:
http://www.ruanyifeng.com/blog/2011/08/a_detailed_explanation_of_jquery_deferred_object.html
Promise对象 异步管理:http://www.jianshu.com/p/063f7e490e9a
var promise1 = function() {
return new Promise(function(resolve, reject) {
setTimeout(function() {
resolve("w(゚Д゚)w");
}, 2000)
});
}
var promise2 = function() {
return new Promise(function(resolve, reject) {
setTimeout(function() {
resolve("w(゚Д゚)w2");
}, 2000)
});
}
promise1().then(function(value) {
console.log(value)
// success
return promise2();//这样就能链式调用了
}, function(value) {
// failure
}).then(function(value) {
console.log("第二个提示" + value)
})
return new Promise(function(resolve, reject) {
setTimeout(function() {
resolve("w(゚Д゚)w");
}, 2000)
});
}
var promise2 = function() {
return new Promise(function(resolve, reject) {
setTimeout(function() {
resolve("w(゚Д゚)w2");
}, 2000)
});
}
promise1().then(function(value) {
console.log(value)
// success
return promise2();//这样就能链式调用了
}, function(value) {
// failure
}).then(function(value) {
console.log("第二个提示" + value)
})
0 0
- jquery ajax监听 then when done
- jquery中$.when,$.then,$.done等的用法
- jquery 中的deffered和promise对象方法及$when done then的使用
- jquery(zepto) when then 使用
- jquery 中$.ajax().done() 的用法
- jquery中的ajax中的done方法
- jquery ajax监听事件
- 一周乱弹(1,js if(!param)判断,2,jquery发送多个ajax请求 $.when().then()3,清空表单)
- case when then else
- mssql ,case ,when,then
- case when then else
- case when then end
- CASE when then
- case when then
- sql --case when then
- case when then else
- case..when..then
- case when then
- 安装配置Jpcap,使用jpcap抓包
- 学习笔记—在laravel4.2中配置mongodb
- android Studio将String.xml中的字段导出。
- iOS原生Http请求,get post 异步
- Arduino 和LCD1602液晶屏 I2C接口实验
- jquery ajax监听 then when done
- Alfred 爬坑
- HashMap为什么是线程不安全的
- pyhton 中的字符串切片问题
- Button英文字符自动大写的问题
- poj1050
- 自定义UITableView,实现cell的三级分组展开收起
- 移动端开发调试工具,别点,就两个链接而已
- PDF转Word转换器