Posts

Showing posts from December, 2020

How to get your Current Location with Javascript | HTML5 Geolocation API

 HTML5 Geolocation API We can get our location using HTML5 Geolocation API.  HTML5 Geolocation API is used to return the current position of the users. Any one can get there current location using  HTML5 Geolocation API. Things you should know before using  HTML5 Geolocation API You must have a little knowledge before you starting with  HTML5 Geolocation API are: HTML Javascript HTML is a markup language which is use for designing web page. Javascript   is a programming language which is use to make web page more interactive. HTML5 Geolocation API navigator.geolocation();  //this is use to get geolocation First check if your browser is supporting the navigator.geolocation() :          if(navigator.geolocation){          console.log("Your browser is support this function"); } This will tell you whether your browser is supporting the navigator.geolocation() or not. Use of getCurrentPosition() : The getCurrentPosition() function is use to get current position by passing the ar