languagechange

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

当用户首选语言更改时,将在全局范围对象上触发 languagechange 事件。

General info

Interface
Event
Bubbles

No

Cancelable

No

Target

The default window scope, being Window on Web pages and WorkerGlobalScope in Web Workers.

Default Action

None

Properties

Being of type Event, this event implements the properties of this interface.

Event.target 只读

Returns an EventTarget that is the topmost target in the DOM tree of the event.

Event.type 只读

Returns a DOMString representing the type of event, here "languagechange".

Event.bubbles只读

Returns a Boolean (en-US) indicating if the event normally bubbles or not.

Event.cancelable只读

Returns a Boolean (en-US) indicating if it is possible to cancel the event.

Specification

Specification
HTML Standard
# event-languagechange
HTML Standard
# handler-window-onlanguagechange

Browser compatibility

BCD tables only load in the browser

See also