安全上下文
此特征只可用于
安全上下文
(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
只读
安全上下文
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. |
推荐 | 最初的规范。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
GeolocationPositionError
|
Chrome
79
|
Edge
79
|
Firefox
72
|
IE
9
Alternate Name
|
Opera
16
Alternate Name
|
Safari
5
Alternate Name
|
WebView Android
79
|
Chrome Android
79
|
Firefox Android
4
Alternate Name
|
Opera Android
16
Alternate Name
|
Safari iOS
Yes
Alternate Name
|
Samsung Internet Android
12.0
|
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 |
完整支持
不支持
使用非标名称。
GeolocationPositionError