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"]);
});
免费:商业的未来
Chris Anderson / 中信出版集团 / 2015-10-1 / 35.40
《免费》,这是一个商业模式不断被颠覆、被改写的时代。一种商业模式既可以统摄未来市场,也可以挤垮当前市场——在我们这个现代经济社会里,这并不是一件不可能的事情。“免费”就是这样的一种商业模式,它代表了互联网时代的商业未来。 “免费”商业模式是一种建立在以电脑字节为基础上的经济学,而非过去建立在物理原子基础上的经济学。在原子经济中,随着时间的推移,我们周围的物品都在逐渐升值。但是在字节经济的网络......一起来看看 《免费:商业的未来》 这本书的介绍吧!
