Get to know MDN better
此頁面由社群從英文翻譯而來。了解更多並加入 MDN Web Docs 社群。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2020年7月.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
GeolocationPositionError 介面的 code 唯讀屬性是一個表示錯誤碼的 unsigned short。
可能的值如下:
| 1 | PERMISSION_DENIED | 取得地理位置訊息失敗,因為頁面沒有權限執行此操作。 |
| 2 | POSITION_UNAVAILABLE | 取得地理位置失敗,因為一個或多個內部位置來源回傳了內部錯誤。 |
| 3 | TIMEOUT | 未能在允許的時間內取得地理位置訊息。 |
| Geolocation # code-attribute |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年7月4日 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.