GlobalEventHandlers.onclose

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2022.

io error: No such file or directory (os error 2) (/home/runner/work/yari/yari/mdn/translated-content/files/es/web/api/html_dom_api/index.md)

Un gestor de eventos para los eventos de cerrar enviados a la ventana. (No disponible con Firefox 2 o Safari)

Sintaxis

window.onclose = funcRef;

Parámetros

  • funcRef es una referencia a una función.

Ejemplo

js
window.onclose = resetThatServerThing;

Especificaciones

Specification
HTML Standard
# event-close

Compatibilidad con Navegadores

BCD tables only load in the browser