Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is not Baseline because it does not work in some of the most widely-used browsers.
error イベントは、センサーで例外が発生したとき発火します。
Sensor はベースクラスであり、onerror および error イベントは派生クラスからのみ利用可能です。
このイベントの発生後、Sensor オブジェクトは idle 状態になります。センサーが値を読んでいた場合は、再び開始されるまで停止します。
addEventListener() のようなメソッドでイベント名を用いるか、イベントハンドラープロパティを設定します。
Event から派生した SensorErrorEvent です。
Event SensorErrorEvent以下のプロパティに加え、親インターフェイスの Event 由来のプロパティが利用可能です。
error 読取専用投げられた DOMException を返します。
この例では、Accelerometer で発生したエラーを記録するイベントリスナーを追加します。
| Generic Sensor API # sensor-onerror |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2023年8月26日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.