Created
September 1, 2013 03:04
-
-
Save dmshvetsov/6402079 to your computer and use it in GitHub Desktop.
This file contains 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
if (navigator.geolocation) { | |
navigator.geolocation.getCurrentPosition(function (position) { | |
var latitude = position.coords.latitude; | |
var longitude = position.coords.longitude; | |
//code for displaying results | |
//document.getElementById('show-lat-lon').innerHTML='<p>' + latitude + ' ' + longitude + '</p>'; | |
}); | |
} else { | |
alert("Geolocation API is not supported in your browser."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment