WindowEventHandlers
The WindowEventHandlers mixin describes the event handlers common to several interfaces like Window, or HTMLBodyElement and HTMLFrameSetElement. Each of these interfaces can implement additional specific event handlers.
Note: WindowEventHandlers is a mixin and not an interface; you can't actually create an object of type WindowEventHandlers.
Properties
The events properties, of the form onXYZ, are defined on the WindowEventHandlers, and implemented by Window, and WorkerGlobalScope for Web Workers.
WindowEventHandlers.onafterprint-
Is an event handler representing the code to be called when the
afterprintevent is raised. WindowEventHandlers.onbeforeprint-
Is an event handler representing the code to be called when the
beforeprintevent is raised. WindowEventHandlers.onbeforeunload-
Is an event handler representing the code to be called when the
beforeunloadevent is raised. WindowEventHandlers.onhashchange-
Is an event handler representing the code to be called when the
hashchangeevent is raised. WindowEventHandlers.onlanguagechange-
Is an event handler representing the code to be called when the
languagechangeevent is raised. WindowEventHandlers.onoffline-
Is an event handler representing the code to be called when the
offlineevent is raised. WindowEventHandlers.ononline-
Is an event handler representing the code to be called when the
onlineevent is raised. WindowEventHandlers.onpagehide-
Is an event handler representing the code to be called when the
pagehideevent is raised. WindowEventHandlers.onpageshow-
Is an event handler representing the code to be called when the
pageshowevent is raised. WindowEventHandlers.onpopstate-
Is an event handler representing the code to be called when the
popstateevent is raised. WindowEventHandlers.onrejectionhandled-
Is an event handler representing the code to be called when the
rejectionhandledevent is raised, indicating that aPromisewas rejected and the rejection has been handled. WindowEventHandlers.onstorage-
Is an event handler representing the code to be called when the
storageevent is raised. WindowEventHandlers.onunhandledrejection-
Is an event handler representing the code to be called when the
unhandledrejectionevent is raised, indicating that aPromisewas rejected but the rejection was not handled. WindowEventHandlers.onunload-
Is an event handler representing the code to be called when the
unloadevent is raised.
Methods
This interface defines no method.
Specifications
| Specification |
|---|
| HTML Standard # windoweventhandlers |
Browser compatibility
BCD tables only load in the browser