WindowEventHandlers - Web APIs 编辑

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 EventHandler representing the code to be called when the afterprint event is raised.
WindowEventHandlers.onbeforeprint
Is an EventHandler representing the code to be called when the beforeprint event is raised.
WindowEventHandlers.onbeforeunload
Is an EventHandler representing the code to be called when the beforeunload event is raised.
WindowEventHandlers.onhashchange
Is an EventHandler representing the code to be called when the hashchange event is raised.
WindowEventHandlers.onlanguagechange This is an experimental API that should not be used in production code.
Is an EventHandler representing the code to be called when the languagechange event is raised.
WindowEventHandlers.onmessage
Is an EventHandler representing the code to be called when the message event is raised.
WindowEventHandlers.onmessageerror
Is an EventHandler representing the code to be called when the MessageError event is raised.
WindowEventHandlers.onoffline
Is an EventHandler representing the code to be called when the offline event is raised.
WindowEventHandlers.ononline
Is an EventHandler representing the code to be called when the online event is raised.
WindowEventHandlers.onpagehide
Is an EventHandler representing the code to be called when the pagehide event is raised.
WindowEventHandlers.onpageshow
Is an EventHandler representing the code to be called when the pageshow event is raised.
WindowEventHandlers.onpopstate
Is an EventHandler representing the code to be called when the popstate event is raised.
WindowEventHandlers.onrejectionhandled
Is an EventHandler representing the code to be called when the rejectionhandled event is raised, indicating that a Promise was rejected and the rejection has been handled.
WindowEventHandlers.onstorage
Is an EventHandler representing the code to be called when the storage event is raised.
WindowEventHandlers.onunhandledrejection
Is an EventHandler representing the code to be called when the unhandledrejection event is raised, indicating that a Promise was rejected but the rejection was not handled.
WindowEventHandlers.onunload
Is an EventHandler representing the code to be called when the unload event is raised.

Methods

This interface defines no method.

Specifications

SpecificationStatusComment
HTML Living Standard
The definition of 'WindowEventHandlers' in that specification.
Living StandardNo change since the latest snapshot, HTML 5.1.
HTML 5.1
The definition of 'WindowEventHandlers' in that specification.
RecommendationSnapshot of HTML Living Standard. Added onlanguage since the HTML5 snapshot.
HTML5
The definition of 'WindowEventHandlers' in that specification.
RecommendationSnapshot 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:94 次

字数:12442

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文