这篇翻译不完整。请帮忙从英语翻译这篇文章

Worker 接口中的 terminate()  方法用于立即终止 Worker 的行为. 本方法并不会等待 worker 去完成它剩余的操作;worker 将会被立刻停止

Syntax

myWorker.terminate();

参数

没有。

返回值

Void.

Example

以下代码示例表明,通过使用 Worker() 构造器创建出的Worker 对象,在下一步操作之后会被立即终止。

var myWorker = new Worker('worker.js');

myWorker.terminate();

Specifications

Specification Status Comment
HTML Living Standard
Worker.terminate()
Living Standard  

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 4 (Yes) 3.5 10.0 10.6 4
Feature Android Edge Firefox Mobile (Gecko) Firefox OS (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 4.4 (Yes) 3.5 1.0.1 10.0 11.5 5.1

See also

Worker 接口。

文档标签和贡献者

 此页面的贡献者: umbrella_coder, kamilic
 最后编辑者: umbrella_coder,