Created
October 28, 2009 22:47
-
-
Save seungjin/220939 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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