Skip to content

Instantly share code, notes, and snippets.

@seungjin
Created October 28, 2009 22:47
Show Gist options
  • Save seungjin/220939 to your computer and use it in GitHub Desktop.
Save seungjin/220939 to your computer and use it in GitHub Desktop.
<html>
<head>
<script>
// only works with firefox 3.5
if (navigator.geolocation) {
var watchID = navigator.geolocation.watchPosition(function(position) {
do_something(position.coords.latitude, position.coords.longitude);
}
);
} else {
alert("I'm sorry, but geolocation services are not supported by your browser.");
}
function do_something(lat,long){
alert(lat);
alert(long);
}
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment