Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function find() {
- if (!navigator.geolocation){
- output.innerHTML = "<p>Geolocation is not supported by your browser</p>";
- return;
- }
- function success(position) {
- var latitude = position.coords.latitude;
- var longitude = position.coords.longitude;
- // alert(latitude + ' ' + longitude);
- };
- function error() {
- var error = "Unable to retrieve your location";
- // alert(error);
- };
- navigator.geolocation.getCurrentPosition(success, error);
- }
- find();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement