title: Geolocation not working in safari
body: <p>Im trying to implement the geolocation services to get the latitude and longitude values, but in Safari it just doesnt work. And then in firefox it works, but it doesnt know how to handle errors. I have no idea why. </p>
  
  <p>Below is my code. </p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;title&gt;GPS&lt;/title&gt;
  
  
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
      &lt;strong&gt;Output:&lt;/strong&gt;
  
  
  
  
      &lt;input type="text" id = "mapLink" value=""&gt;
  
  
     &lt;script type = "text/javascript"&gt;
  
  
      navigator.geolocation.getCurrentPosition(showMap, handle_error);
  
  
    function showMap(position){
  
      var lat = position.coords.latitude;
  
      var long = position.coords.longitude;
  
      var linkUrl = lat + "," + long;
  
      var mapLink = document.getElementById("mapLink");
  
      mapLink.value = linkUrl;
  
  
  
    } 
  
      function handle_error(err) {
          alert('error');
      }
    &lt;/script&gt;
  
  
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>