过时
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
onclose
特性为
WorkerGlobalScope
interface represents an
EventHandler
to be called when the
close
event occurs and bubbles through the
Worker
.
This non-standard event handler was only implemented by a few browsers and has been removed from all or nearly all of them.
self.onclose = function() { ... };
The following code snippet shows an
onclose
handler set inside a worker:
self.onclose = function() {
console.log('Your worker instance has been closed');
}
This feature is no longer defined in any specifications.
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
onclose
弃用
非标
|
Chrome 4 | Edge 12 | Firefox 3.5 — 50 | IE Yes | Opera 11.5 | Safari 4 | WebView Android 37 | Chrome Android 40 | Firefox Android 4 — 50 | Opera Android Yes | Safari iOS 5.1 | Samsung Internet Android 4.0 |
完整支持
不支持
非标。预期跨浏览器支持较差。
弃用。不要用于新网站。
WorkerGlobalScope
interface it belongs to.