Monday 24 August 2015

Detecting Browser Geolocation Info

One interesting aspect of web development is geolocation; where is your user viewing your website from? You can base your language locale on that data or show certain products in your store based on the user's location. Let's examine how you can use the geolocation API to get location details!

Feature detection is the best way to confirm the Geolocation API is avilable.
if("geolocation" in navigator) {
  
 }else {
         alert("No soup for you!  Your browser does not support this feature");
 }