position object

Provides geographic coordinates and other properties that represent a geographic location.

Internet Explorer 9



The position object has these types of members:


The position object has these properties.



Gets a reference to a coordinates object that contains geographic information returned by the getCurrentPosition or watchPosition functions.


Gets the time associated with the geographic information, typically the time the information was received by Internet Explorer.


Standards information

There are no standards that apply here.


The position object is passed as a parameter to the callback function defined for the getCurrentPosition function and the watchPosition function.

Windows Internet Explorer 9. The position object is only supported for webpages displayed in IE9 Standards mode. For more information, see Defining Document Compatibility.


The following example shows how to access the position object, which is passed as the position parameter of the successCallback function.

<!DOCTYPE html>  
<title>Requesting Location</title>
<script type="text/javascript">
function setText(val, e) {
    document.getElementById(e).value = val;
function insertText(val, e) {
    document.getElementById(e).value += val;
var nav = null; 
function requestPosition() {
  if (nav == null) {
      nav = window.navigator;
  if (nav != null) {
      var geoloc = nav.geolocation;
      if (geoloc != null) {
      else {
          alert("geolocation not supported");
  else {
      alert("Navigator not found");
function successCallback(position)
   setText(position.coords.latitude, "latitude");
   setText(position.coords.longitude, "longitude");
<label for="latitude">Latitude: </label><input id="latitude" /> <br />
<label for="longitude">Longitude: </label><input id="longitude" /> <br />
<input type="button" onclick="requestPosition()" value="Get Latitude and Longitude"  />