HTML5 Archive

HTML5 Geolocation api allows us to get the current location using a simple JavaScript function. On the modern browsers the location information can be retrieved using the Navigator object. HTML5 Geolocation API Navigator.geolocation() This function simply queries the browser about the location from which the webpage is getting loaded.The browser which uses the location provider (in our case Google maps) to get the location information using the public IP address,MAC,Wifi information which is sent by the browser itself. As accessing the physical location impacts user privacy the above function will not work when the user denies the permission for it. Geolocation is not supported only in modern browsers with HTML5 capabilities. To ensure this first we have to check the geolocation support. 12345678if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(onsuccess,onfailure); }

Read More...