Created
February 10, 2011 21:40
-
-
Save brianherbert/821402 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
function geo_success(loc) { | |
$("#location_status").html('Location Found: '+loc.coords.latitude+','+loc.coords.longitude); | |
$("#lat").val(loc.coords.latitude); | |
$("#lon").val(loc.coords.longitude); | |
} | |
function geo_error() { | |
$("#location_status").html('Sorry, location search failed. Please try again.'); | |
} | |
if (geo_position_js.init()) { | |
$("#location_status").html('Please wait while we locate your device.'); | |
geo_position_js.getCurrentPosition(geo_success, geo_error); | |
}else{ | |
$("#location_status").html('Sorry, your browser does not support geolocation.'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment