<!DOCTYPE html>
<html>
<body onload="GetLocation()">
<script type="text/javascript">
function GetLocation() {
if(navigator.geolocation) {
navigator.geolocation.getCurrentPosition(success_handler);
}
}
function success_handler(position) {
alert('Latitude: ' + position.coords.latitude + '\nLongitude: ' + position.coords.longitude + '\nPrecisão: ' + position.coords.accuracy + 'm');
}
</script>
</body>
</html>