diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/geolocationpositionerror/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/geolocationpositionerror/index.html')
-rw-r--r-- | files/zh-cn/web/api/geolocationpositionerror/index.html | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/geolocationpositionerror/index.html b/files/zh-cn/web/api/geolocationpositionerror/index.html new file mode 100644 index 0000000000..ce69f4eb77 --- /dev/null +++ b/files/zh-cn/web/api/geolocationpositionerror/index.html @@ -0,0 +1,135 @@ +--- +title: PositionError +slug: Web/API/GeolocationPositionError +tags: + - API + - Geolocation API +translation_of: Web/API/GeolocationPositionError +--- +<p>{{APIRef("Geolocation API")}}</p> + +<p><strong><code>PositionError</code></strong> 接口表示当定位设备位置时发生错误的原因。</p> + +<h2 id="属性">属性</h2> + +<p><em><code>PositionError</code> 接口没有继承任何属性。</em></p> + +<dl> + <dt>{{domxref("PositionError.code")}} {{readonlyInline}}</dt> + <dd>返回无符号的、简短的错误码。下列值是可能的: + <table class="standard-table"> + <tbody> + <tr> + <th scope="col">值</th> + <th scope="col">相关联的常量</th> + <th scope="col">描述</th> + </tr> + <tr> + <td><code>1</code></td> + <td><code>PERMISSION_DENIED</code></td> + <td>地理位置信息的获取失败,因为该页面没有获取地理位置信息的权限。</td> + </tr> + <tr> + <td><code>2</code></td> + <td><code>POSITION_UNAVAILABLE</code></td> + <td> + <p>地理位置获取失败,因为至少有一个内部位置源返回一个内部错误。</p> + </td> + </tr> + <tr> + <td><code>3</code></td> + <td><code>TIMEOUT</code></td> + <td> + <p>获取地理位置超时,通过定义{{domxref("PositionOptions.timeout")}} 来设置获取地理位置的超时时长。</p> + </td> + </tr> + </tbody> + </table> + </dd> + <dt>{{domxref("PositionError.message")}} {{readonlyInline}}</dt> + <dd>返回一个开发者可以理解的 {{domxref("DOMString")}} 来描述错误的详细信息。</dd> +</dl> + +<h2 id="方法">方法</h2> + +<p><em><em><code>PositionError</code> 接口没有实现也没有<em>继承任何方法。</em></em></em></p> + +<h2 id="标准">标准</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('Geolocation', '#positionerror', 'PositionError')}}</td> + <td>{{Spec2('Geolocation')}}</td> + <td>Initial specification.</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<p>{{ CompatibilityTable() }}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Basic support</td> + <td>5</td> + <td>{{CompatGeckoDesktop("1.9.1")}}</td> + <td>9</td> + <td>10.60<br> + Removed in 15.0<br> + Reintroduced in 16.0</td> + <td>5</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Android</th> + <th>Chrome for Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatUnknown()}}</td> + <td>{{CompatUnknown()}}</td> + <td>{{CompatGeckoMobile("4")}}</td> + <td>{{CompatUnknown()}}</td> + <td>10.60</td> + <td>{{CompatUnknown()}}</td> + </tr> + </tbody> +</table> +</div> + +<h2 id="请参见">请参见</h2> + +<ul> + <li><a href="/en-US/docs/WebAPI/Using_geolocation" title="/en-US/docs/WebAPI/Using_geolocation">Using geolocation</a></li> + <li>The {{domxref("Geolocation")}} interface that use it.</li> +</ul> |