Html5 简明教程

HTML5 - Web Workers

JavaScript 是设计为在单线程环境中运行的,这意味着多个脚本无法同时运行。考虑一下你需要处理 UI 事件、查询和处理大量 API 数据以及操作 DOM 的情形。

JavaScript was designed to run in a single-threaded environment, meaning multiple scripts cannot run at the same time. Consider a situation where you need to handle UI events, query and process large amounts of API data, and manipulate the DOM.

你可以在 here 获得源代码

You can get source code at here