In this video I have explained the newest version of html5 which includes APIs and this one is unique because it helps out to find out the user's current location and as well as the user's watch position as same as in google maps. So, the user's location can be accessed by writing this code: navigator.geolocation.getCurrentPosition. Basically there are three geolocation methods 1) getCurrentPosition 2) watchPosition 3) clearWatch.
getCurrentPosition holds three parameters the first is successCallback function the next is errorCallback function and the last is options. Success Callback function basically tells the user location's coordinates which is Latitude and Longitude that if the user allow you to access his/her location only then you can get his current position's latitude and longitude values and if the user click on the option block which means he does not wants to give his location and in that case error callback function rises.
The Code is given below but for that you have to subscribe my channel (It's Free to Subscribe):