Browsers that support the Geolocation API define
navigator.geolocation. This property refers
to an object with three methods:
Request the user’s current position.
Request the current position, but also continue to monitor position and invoke the specified callback when the user’s position changes.
Stop watching the user’s location. The argument to this
method should be the number returned by the corresponding call
In devices that include GPS hardware, very precise location information can be obtained from the GPS unit. More commonly, however, location information comes via the Web. If a browser submits your Internet IP address to a web service, it can usually determine (based on ISP records) what city you are in (and it is common for advertisers to do this on the server side). A browser can often obtain an even more precise location by asking the operating system for the list of nearby wireless networks and their signal strengths. ...