Created
July 29, 2011 14:48
-
-
Save raykrueger/1113961 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
if (!!navigator.geolocation) { | |
navigator.geolocation.getCurrentPosition( | |
function(position) { | |
var lat = position.coords.latitude; | |
var lng = position.coords.longitude; | |
$.get('/locate?lat=' + lat + '&lng=' + lng, function(data){ | |
$('#locations').html(data); | |
}); | |
}, | |
function(e) { | |
alert("Something bad happened, I cannot get your current location."); | |
} | |
); | |
} else { | |
alert("Sorry, your browser is inferior. IE?"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment