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
EventHandlerrepresenting the code to be called when theafterprintevent is raised. WindowEventHandlers.onbeforeprint- Is an
EventHandlerrepresenting the code to be called when thebeforeprintevent is raised. WindowEventHandlers.onbeforeunload- Is an
EventHandlerrepresenting the code to be called when thebeforeunloadevent is raised. WindowEventHandlers.onhashchange- Is an
EventHandlerrepresenting the code to be called when thehashchangeevent is raised. WindowEventHandlers.onlanguagechange- Is an
EventHandlerrepresenting the code to be called when thelanguagechangeevent is raised. WindowEventHandlers.onmessage- Is an
EventHandlerrepresenting the code to be called when themessageevent is raised. WindowEventHandlers.onoffline- Is an
EventHandlerrepresenting the code to be called when theofflineevent is raised. WindowEventHandlers.ononline- Is an
EventHandlerrepresenting the code to be called when theonlineevent is raised. WindowEventHandlers.onpagehide- Is an
EventHandlerrepresenting the code to be called when thepagehideevent is raised. WindowEventHandlers.onpageshow- Is an
EventHandlerrepresenting the code to be called when thepageshowevent is raised. WindowEventHandlers.onpopstate- Is an
EventHandlerrepresenting the code to be called when thepopstateevent is raised. WindowEventHandlers.onstorage- Is an
EventHandlerrepresenting the code to be called when thestorageevent is raised. WindowEventHandlers.onunhandledrejection- An event handler for unhandled
Promiserejection events. WindowEventHandlers.onunload- Is an
EventHandlerrepresenting the code to be called when theunloadevent is raised.
Methods
This interface defines no method.
Specifications
| Specification | Status | Comment |
|---|---|---|
| WHATWG HTML Living Standard The definition of 'GlobalEventHandlers' in that specification. |
Living Standard | No change since the latest snapshot, HTML 5.1. |
| HTML 5.1 The definition of 'GlobalEventHandlers' in that specification. |
Recommendation | Snapshot of WHATWG HTML Living Standard. Added onlanguage since the HTML5 snapshot. |
| HTML5 The definition of 'GlobalEventHandlers' in that specification. |
Recommendation | Snapshot of WHATWG HTML Living Standard. Creation of WindowEventHandlers (properties where on the target before it). |
Browser compatibility
| Feature | Firefox (Gecko) | Chrome | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | (Yes) | (Yes) | ? | ? | ? |
onhashchange |
3.6 (1.9.2) | ? | ? | ? | ? |
onlanguage |
32 (32) | ? | ? | ? | ? |
onstorage |
45 (45) | ? | ? | ? | ? |
| Feature | Firefox Mobile (Gecko) | Android | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | (Yes) | ? | ? | ? | ? |
onhashchange |
1.0 (1.9.2) | ? | ? | ? | ? |
onlanguage |
32.0 (32) | ? | ? | ? | ? |
onstorage |
45 (45) | ? | ? | ? | ? |