Skip to content

Instantly share code, notes, and snippets.

@kelso
Created July 14, 2013 16:57
Show Gist options
  • Save kelso/5994926 to your computer and use it in GitHub Desktop.
Save kelso/5994926 to your computer and use it in GitHub Desktop.
Get geolocation with one line of JavaScript
navigator.geolocation.getCurrentPosition(function(position){ alert(position.coords.latitude + ", " + position.coords.longitude) });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment