GlobalEventHandlers.onclose

送至視窗的 close event 的處理器(handler)。(不支援 Firefox 2 及 Safari)

語法

window.onclose = funcRef;

參數

  • funcRef 為函式的參照。

範例

window.onclose = resetThatServerThing;

規範

規範 狀態 備註
HTML Living Standard
The definition of 'onclose' in that specification.
Living Standard  

瀏覽器相容性

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! (en-US)
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support (Yes) ? ? ? No support
Feature Android Android Webview Chrome for Android Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile
Basic support ? (Yes) (Yes) ? ? ? ? No support