Created
August 29, 2011 18:36
-
-
Save p5150j/1179066 to your computer and use it in GitHub Desktop.
Geo Javascript
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>Geolocation</title> | |
| </head> | |
| <body> | |
| <script> | |
| function get_location() { | |
| navigator.geolocation.getCurrentPosition(show_map); | |
| }; | |
| if(navigator.geolocation) { | |
| navigator.geolocation.getCurrentPosition(function(position) { | |
| alert('BAM !!! ' + position.coords.latitude + ' / ' + position.coords.longitude); | |
| alert('Ahhh shit...City is: ' + position.address.city + ', ' + position.address.region) | |
| }); | |
| } | |
| </script> | |
| <body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment