jQuery Deferred
- 授权协议: 未知
- 开发语言:
- 操作系统: 未知
- 软件首页: http://plugins.jquery.com/project/deferred
软件介绍
Simple and clean asynchronous/nonblocking processing system JSDeferred (is like MochiKit and with some extension) with jQuery supports.
jQuery supports: overwrite ajax functions get, post and getJSON to return Deferred object (no arguments change).
Collect some asynchronous resources by ajax.
parallel([
$.get("a.html").next(function (data) {
return data.match(/([^<]+)<\/title>/);
}),
$.get("b.txt" ).next(function (data) {
return data.match(/##\s*([^<]+)\s*##/);
}),
$.getJSON("c.json").next(function (data) {
return data.title;
})
]).next(function (values) {
print("Titles "+values.join(", "));
});
Divided loop for non stress browsing. When long time processing is required, it is bad that simply using only for loop because it stops browser appearance. Deferred resolves it with bare minimum of effort.
loop({begin: 1, end:100, step:10}, function (n, o) {
print(["Processing divided loop:n=", n].join(""));
for (var i = 0; i < o.step; i++) {
var j = n + i;
print(j);
}
});
Like tail call code. If you are habituated to functional programming, this syntax may be familiar to you.
next(function () {
function pow (x, n) {
function _pow (n, r) {
if (n == 0) return r;
return call(_pow, n - 1, x * r);
}
return call(_pow, n, 1);
}
return call(pow, 2, 10);
}).
next(function (r) {
log([r, "end"]);
});
JavaScript核心技术
Shelley Powers / 苏敬凯 / 机械工业出版社 / 2007-6 / 45.00
Ajax是当今Web开发领域最流行的词汇。而JavaScript与CSS、XML和DOM几种老技术,加上XMLHttpRequest就构成了Ajax的四大基石。对于JavaScript,一些更资深的同事告诉我的感觉是失望。面对不同的浏览器和浏览器的不同版本,没有优秀的调试开发工具,JavaScript成了软件开发的泥潭。. 而本书的出版则给我们增加了一丝解决这些问题的信心。 它从最简单......一起来看看 《JavaScript核心技术》 这本书的介绍吧!
URL 编码/解码
URL 编码/解码
XML、JSON 在线转换
在线XML、JSON转换工具
