i have been trying to run this code to get latitude and longitude. My IE browser shows the message that geolocation services are not supported, and Chrome says 'This page has been blocked from tracking your location' even after i set the location setting in chrome to allow all sites to track. Please help.
<html>
<head></head>
<body>
<input type="button" id="btnSearch" value="Search" onclick="doSomething();"/>
<script>
function doSomething(){
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(handle_geolocation_query);
function handle_geolocation_query(position) {
alert('Lat: ' + position.coords.latitude + ' ' + 'Lon: ' + position.coords.latitude);
}
} else {
alert("I'm sorry, but geolocation services are not supported by your browser.");
}
}
</script>
</body>
</html>