WorkerGlobalScope: languagechange イベント
languagechange
イベントは、ユーザーの推奨言語が変更されたときにグローバルスコープオブジェクトで発生します。
このイベントはキャンセル不可で、バブリングしません。
構文
このイベント名を addEventListener()
などのメソッドで使用するか、イベントハンドラープロパティを設定するかしてください。
js
addEventListener("languagechange", (event) => {});
onlanguagechange = (event) => {};
イベント型
一般的な Event
です。
例
languagechange
は addEventListener
メソッドで使用することができます。
js
worker.addEventListener("languagechange", () => {
console.log("languagechange event detected!");
});
または、 onlanguagechange
イベントハンドラープロパティを使用します。
js
worker.onlanguagechange = (event) => {
console.log("languagechange event detected!");
};
仕様書
Specification |
---|
HTML # event-languagechange |
HTML # handler-workerglobalscope-onlanguagechange |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
languagechange event |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.