Created
October 4, 2010 17:14
-
-
Save pavenuto/610078 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
function geoLocate() | |
{ | |
navigator.geolocation.getCurrentPosition(foundLocation, noLocation); | |
} | |
function foundLocation(position) | |
{ | |
var lat = position.coords.latitude; | |
var long = position.coords.longitude; | |
window.location="/locations/geo/" + lat + "," + long; | |
} | |
function noLocation() | |
{ | |
alert('Could not find location'); | |
} | |
$(document).ready(function() { | |
geoLocate(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment