Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 522659 of PositionError

  • Revision slug: Web/API/PositionError
  • Revision title: PositionError
  • Revision id: 522659
  • Created:
  • Creator: Scimonster
  • Is current revision? No
  • Comment Replace "had" with "have".

Revision Content

The PositionError interface represents the reason of an error occuring when using the geolocating device.

Properties

The PositionError interface doesn't inherit any property.

{{domxref("PositionError.code")}} {{readonlyInline}}
Returns an unsigned short representing the error code. The following values are possible:
Value Associated constant Description
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 one or several internal source of position returned an internal error.
3 TIMEOUT The time allowed to acquire the geolocation, defined by {{domxref("PositionOptions.timeout")}} information was reached before the information was obtained.
{{domxref("PositionError.message")}} {{readonlyInline}}
Returns a human-readable {{domxref("DOMString")}} describing the details of the error.

Methods

The PositionError interface neither implements, nor inherit any method.

Specifications

Specification Status Comment
{{SpecName('Geolocation', '#positionerror', 'PositionError')}} {{Spec2('Geolocation')}} Initial specification.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 5 {{CompatGeckoDesktop("1.9.1")}} 9 10.60
Removed in 15.0
Reintroduced in 16.0
5
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatUnknown()}} {{CompatUnknown()}} {{CompatGeckoMobile("4")}} {{CompatUnknown()}} 10.60 {{CompatUnknown()}}

See also

Revision Source

<p>The <strong><code>PositionError</code></strong> interface represents the reason of an error occuring when using the geolocating device.</p>
<h2 id="Properties">Properties</h2>
<p><em>The <code>PositionError</code> interface </em><em><em>doesn't inherit any property</em></em>.</p>
<dl>
 <dt>
  {{domxref("PositionError.code")}} {{readonlyInline}}</dt>
 <dd>
  Returns an <code>unsigned short</code> representing the error code. The following values are possible:
  <table class="standard-table">
   <tbody>
    <tr>
     <th scope="col">Value</th>
     <th scope="col">Associated constant</th>
     <th scope="col">Description</th>
    </tr>
    <tr>
     <td><code>1</code></td>
     <td><code>PERMISSION_DENIED</code></td>
     <td>The acquisition of the geolocation information failed because the page didn't have the permission to do it.</td>
    </tr>
    <tr>
     <td><code>2</code></td>
     <td><code>POSITION_UNAVAILABLE</code></td>
     <td>The acquisition of the geolocation failed because one or several internal source of position returned an internal error.</td>
    </tr>
    <tr>
     <td><code>3</code></td>
     <td><code>TIMEOUT</code></td>
     <td>The time allowed to acquire&nbsp;the geolocation, defined by {{domxref("PositionOptions.timeout")}} information was reached before the information was obtained.</td>
    </tr>
   </tbody>
  </table>
 </dd>
 <dt>
  {{domxref("PositionError.message")}} {{readonlyInline}}</dt>
 <dd>
  Returns a human-readable {{domxref("DOMString")}} describing the details of the error.</dd>
</dl>
<h2 id="Methods">Methods</h2>
<p><em><em>The <code>PositionError</code> interface <em>neither implements, nor inherit any method.</em></em></em></p>
<h2 id="Specifications">Specifications</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="Browser_compatibility">Browser compatibility</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="See_also">See also</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>
Revert to this revision