Warning: The Mozilla Developer Network internet site employs emerging web criteria that will not be entirely supported in some variations of MicroSoft Internet Explorer. You can improve your knowledge of this website by enabling JavaScript.
Introduced in Gecko one.9.2
(Firefox 3.six / Thunderbird 3.one / Fennec one.0)
Acquiring the present position
To obtain the user's current site, you are able to contact the getCurrentPosition() method. This initiates an asynchronous request to detect the user's place, and queries the positioning hardware to get up-to-date information. When the place is determined, a specified callback routine is executed. It is possible to optionally provide a second callback to be executed if an error occurs. A third, optional,
Office Professional Plus 2010 Product Key, parameter is an options interface where you can set the maximum age of the request,
Microsoft Office 2007 Professional Key, and the time to wait for a request.
Use getCurrentPosition() if you want a single place fix ASAP,
Office Professional Plus, regardless of the accuracy. Devices with a GPS,
Office 2010 Home And Business, for example, can take a minute or more to get a GPS fix,
Office 2007 Product Key, so less accurate data (IP place or wifi) might be returned to getCurrentPosition() to start.
navigator.geolocation.getCurrentPosition(function( place) do_something(position.coords.latitude, position.coords.longitude););
The above example will cause the do_something() function to execute when the area is obtained.