Skip to content

Instantly share code, notes, and snippets.

Last active Dec 18, 2016
What would you like to do?
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
if ("geolocation" in navigator) {
navigator.geolocation.getCurrentPosition(function(position) {
document.body.innerHTML = [position.coords.latitude, position.coords.longitude].join('<br>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment