showing results for - "jquery get location of user"
Giorgia
26 Oct 2017
1$("#find_btn").click(function () { //user clicks button
2	if ("geolocation" in navigator){ //check geolocation available 
3		//try to get user current location using getCurrentPosition() method
4		navigator.geolocation.getCurrentPosition(function(position){ 
5				$("#result").html("Found your location <br />Lat : "+position.coords.latitude+" </br>Lang :"+ position.coords.longitude);
6			});
7	}else{
8		console.log("Browser doesn't support geolocation!");
9	}
10});