Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getLocation()
- {
- if (navigator.geolocation)
- {
- navigator.geolocation.getCurrentPosition(showPosition);
- }
- else{x.innerHTML = "Geolocation is not supported by this browser, please manually enter your postcode above";}
- );
- }
- function showPosition(position)
- {
- x.innerHTML = "Latitude: " + position.coords.latitude +
- "<br>Longitude: " + position.coords.longitude;
- }
- navigator.geolocation.getCurrentPosition(
- show_map, handle_error);
- function handle_error(err) {
- if (err.code == 1) {
- // user said no!
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement