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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.