安全上下文
此特征只可用于 安全上下文 (HTTPS),在某些或所有 支持浏览器 .

GeolocationPositionError interface represents the reason of an error occurring when using the geolocating device.

特性

GeolocationPositionError interface doesn't inherit any property .

GeolocationPositionError.code 只读 安全上下文
返回 unsigned short representing the error code. The following values are possible:
Associated constant 描述
1 PERMISSION_DENIED The acquisition of the geolocation information failed because the page didn't have the permission to do it.
2 POSITION_UNAVAILABLE The acquisition of the geolocation failed because at least one internal source of position returned an internal error.
3 TIMEOUT The time allowed to acquire the geolocation, defined by PositionOptions.timeout information was reached before the information was obtained.
GeolocationPositionError.message 只读 安全上下文
Returns a human-readable DOMString describing the details of the error. Specifications note that this is primarily intended for debugging use and not to be shown directly in a user interface.

方法

GeolocationPositionError interface neither implements nor inherits any method.

规范

规范 状态 注释
地理位置 API
The definition of 'GeolocationPositionError' in that specification.
推荐 最初的规范。

浏览器兼容性

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. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
GeolocationPositionError Chrome 79
79
不支持 5 — 78 Alternate Name
Alternate Name Uses the non-standard name: PositionError
Edge 79
79
不支持 12 — 79 Alternate Name
Alternate Name Uses the non-standard name: PositionError
Firefox 72
72
不支持 3.5 — 71 Alternate Name
Alternate Name Uses the non-standard name: PositionError
IE 9 Alternate Name
9 Alternate Name
Alternate Name Uses the non-standard name: PositionError
Opera 16 Alternate Name
16 Alternate Name
Alternate Name Uses the non-standard name: PositionError
Safari 5 Alternate Name
5 Alternate Name
Alternate Name Uses the non-standard name: PositionError
WebView Android 79
79
不支持 ? — 78 Alternate Name
Alternate Name Uses the non-standard name: PositionError
Chrome Android 79
79
不支持 18 — 78 Alternate Name
Alternate Name Uses the non-standard name: PositionError
Firefox Android 4 Alternate Name
4 Alternate Name
Alternate Name Uses the non-standard name: PositionError
Opera Android 16 Alternate Name
16 Alternate Name
Alternate Name Uses the non-standard name: PositionError
Safari iOS Yes Alternate Name
Yes Alternate Name
Alternate Name Uses the non-standard name: PositionError
Samsung Internet Android 12.0
12.0
不支持 1.0 — 12.0 Alternate Name
Alternate Name Uses the non-standard name: PositionError
code Chrome 5 Edge 12 Firefox 3.5 IE 9 Opera 16 Safari 5 WebView Android Yes Chrome Android 18 Firefox Android 4 Opera Android 16 Safari iOS Yes Samsung Internet Android 1.0
message Chrome 5 Edge 12 Firefox 3.5 IE 9 Opera 16 Safari 5 WebView Android Yes Chrome Android 18 Firefox Android 4 Opera Android 16 Safari iOS Yes Samsung Internet Android 1.0
Secure context required Chrome 47 Edge ≤18 Firefox 55 IE No Opera Yes Safari Yes WebView Android 47 Chrome Android 47 Firefox Android 55 Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0

图例

完整支持

完整支持

不支持

不支持

使用非标名称。

另请参阅

元数据

  • 最后修改:
  1. 地理位置 API
  2. GeolocationPositionError
  3. 特性
    1. code
    2. message
  4. Related pages for Geolocation API
    1. Geolocation
    2. GeolocationCoordinates
    3. GeolocationPosition
    4. Navigator.geolocation

版权所有  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1