It is so exciting that when you visit a hotel search website and the site automatically shows you the hotels around your place. The site didn’t even ask your location, but how did it find you? The web browser would have communicated your location on behalf of you, thanks to the Geolocation feature of HTML5. All it takes for the site to find you is just a single line of code (OK, 3 lines!).
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(successCallBack, errorCallBack);
}
Geolocation was introduced with the HTML5, along with few other interesting features, and widely implemented by many modern browsers, such as Firefox 3.5+. Since HTML5 is still being in the acceptance stage, not many websites are making use of the Geolocation support yet. This is because only the latest browsers support the Geolocation. Here’s a short list of browsers and their support level to Geolocation.
Browsers supporting Geolocation
- Firefox was the early adopter of Geolocation. It supports Geolocation from the version 3.5+.
- Opera starts supporting Geolocation from the version 10.6 onwards.
- Google Chrome 5+ supports Geolocation directly. Chrome version <4 supports through Gears API.
- Safari 5+.
- Android browser supports Geolocation through Gears API.
- Internet Explorer 9+.
Well, nothing much changed from the time when I last posted about Geolocation support. The above report is as of February 2010. The data might change as the new versions of browsers getting released.
And, if you are curious, you can test yourself to know whether your browser supports Geolocation or not – HTML5 Geolocation demo. If your browser supports Geolocation, you might see something like this:


{ 2 comments… read them below or add one }
Nice article Veera. As there is change in support for Chrome, it would be nice to update it to keep the article relevant.
definitely Punit. Will update the article.
{ 3 trackbacks }