PositionError
介面表示使用定位設備時發生錯誤的原因。
屬性
PositionError
介面沒有繼承任何屬性。
PositionError.code
Read only- 回傳一個無符號整數
(unsigned short
)來表示錯誤碼。以下列出可能的值:值 相對應的常數 描述 1
PERMISSION_DENIED
取得地理資訊失敗,因為此頁面沒有獲取地理位置信息的權限。 2
POSITION_UNAVAILABLE
取得地理資訊失敗,因為至少有一個地理位置信息內的資訊回傳了錯誤。 3
TIMEOUT
取得地理資訊超過時限,利用 PositionOptions.timeout
來定義取得地理資訊的時限。 PositionError.message
Read only- 回傳一個可讀的
DOMString
來描述錯誤的詳細訊息。注意規格中指出此訊息是用來除錯而非直接顯示在使用者介面。
方法
PositionError
介面沒有實作也沒有繼承任何方法。
規格
Specification | Status | Comment |
---|---|---|
Geolocation API The definition of 'PositionError' in that specification. |
Recommendation | Initial specification. |
瀏覽器的相容性
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 5 | 3.5 (1.9.1) | 9 | 10.60 No support 15.0 16.0 |
5 |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | ? | ? | 4.0 (4) | ? | 10.60 | ? |
請參考
- Using geolocation
Geolocation
介面使用此物件。