Is it possible to get the user's geolocation without a browser prompt?
Here is a sample code from W3
<script> var x = document.getElementById("demo") function getLocation(){ if(navigator.geolocation){ navigator.geolocation.getCurrentPosition(showPosition); } else { x.innerHTML="Geolocation is not supported by this browser.";} } function showPosition(position){ x.innerHTML="Latitude: " + position.coords.latitude + "<br>Longitude: " + position.coords.longitude; } </script>
Is there any preventPrompt() -like function?
source share