WindowEventHandlers

The WindowEventHandlers mixin describes the event handlers common to several interfaces like Window, or HTMLBodyElement (en-US) and HTMLFrameSetElement (en-US). 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 (en-US) for Web Workers.

WindowEventHandlers.onafterprint (en-US)
Is an event handler representing the code to be called when the afterprint (en-US) event is raised.
WindowEventHandlers.onbeforeprint (en-US)
Is an event handler representing the code to be called when the beforeprint (en-US) event is raised.
WindowEventHandlers.onbeforeunload (en-US)
Is an event handler representing the code to be called when the beforeunload (en-US) event is raised.
WindowEventHandlers.onhashchange
Is an event handler representing the code to be called when the hashchange (en-US) event is raised.
WindowEventHandlers.onlanguagechange (en-US)
Is an event handler representing the code to be called when the languagechange (en-US) event is raised.
WindowEventHandlers.onmessage (en-US)
Is an event handler representing the code to be called when the message event is raised.
WindowEventHandlers.onmessageerror (en-US)
Is an event handler representing the code to be called when the MessageError event is raised.
WindowEventHandlers.onoffline
Is an event handler representing the code to be called when the offline (en-US) event is raised.
WindowEventHandlers.ononline
Is an event handler representing the code to be called when the online (en-US) event is raised.
WindowEventHandlers.onpagehide
Is an event handler representing the code to be called when the pagehide (en-US) event is raised.
WindowEventHandlers.onpageshow
Is an event handler representing the code to be called when the pageshow (en-US) event is raised.
WindowEventHandlers.onpopstate
Is an event handler representing the code to be called when the popstate event is raised.
WindowEventHandlers.onstorage
Is an event handler representing the code to be called when the storage (en-US) event is raised.
WindowEventHandlers.onunhandledrejection (en-US)
An event handler for unhandled Promise rejection events.
WindowEventHandlers.onunload (en-US)
Is an event handler representing the code to be called when the unload (en-US) event is raised.

Methods

This interface defines no method.

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'WindowEventHandlers' in that specification.
Living Standard No change since the latest snapshot, HTML 5.1.
HTML 5.1
The definition of 'WindowEventHandlers' in that specification.
Recommendation Snapshot of HTML Living Standard. Added onlanguage since the HTML5 snapshot.
HTML5
The definition of 'WindowEventHandlers' in that specification.
Recommendation Snapshot of HTML Living Standard. Creation of WindowEventHandlers (properties where on the target before it).

Browser compatibility

BCD tables only load in the browser

See also