The Geolocation API, a new feature for HTML5, is managed by an official W3C specification. It allows for a standard way for websites to access location-specific data about the user, provided that the user consents to the request and the hardware support is available. This process uses multiple methods to retrieve the user’s coordinates, via GPS or other geolocation services, and makes the information available over JavaScript.

The website can then choose to process that information in the user’s web browser or send it using an Ajax or form submission callback to the web server for server-side processing.

This is an invaluable tool used by many location-specific websites, such as Google Maps, foursquare, ...

Get HTML5: Your visual blueprint™ for designing rich web pages and applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.