I'd rather use
HTML5 [
^] feature of geolocation.
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
alert("Latitude: " + position.coords.latitude +
", Longitude: " + position.coords.longitude);
}
-KR