在JavaScript中的异步编程(NOT AJAX)
问题描述:
是不是有可能在JavaScript中做的事情异步(AJAX除外)?例如,为了同时遍历多个阵列。它是如何做?一个简单的例子将是很好。搜索这很难,因为所有的AJAX污染,这是不是我所期待的。
Is it possibly to do things asynchronously in javascript (AJAX aside)? For example, to iterate multiple arrays at the same time. How is it done? A brief example would be nice. Searching for this was hard, due to all the ajax pollution, which is not what I am looking for.
先谢谢了。
答
使用网络工作者。但请记住,这是一个非常新的功能,并不是所有的浏览器都完全支持。
Use web Workers. But remember that it is a very new feature and not all browsers are fully supported.