title: How to get current position(city,state,zipcode) in safari browser ?
body: <p>I have tried below code its work for chrom,firefox browser but not work on safari browser on desktop(wired connection) and also not work in windows phone(tested on nokia lumia 625.) but work on my ipad,iphone (through wifi) for safari browser.<br>
  Please give me a solution for this issue.</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"&gt; &lt;/script&gt;
  </code></pre>
  
  <p>in my header call function on load page.</p>
  
  <pre><code>$(document).ready(function() {
      requestPosition();
  });
  </code></pre>
  
  <p>write function in js file </p>
  
  <pre><code>function requestPosition() {
  
      if (typeof navigator.geolocation == "undefined") {
  
          alert("Your browser doesn't support the Geolocation API");
          return;
  
      }
      navigator.geolocation.getCurrentPosition(function(position){
  
      var geocoder = new google.maps.Geocoder();
  
      geocoder.geocode({
          "location": new google.maps.LatLng(position.coords.latitude,position.coords.longitude)
      },
      function (results, status) {
  
        if (status == google.maps.GeocoderStatus.OK) {
              j = 0;
  
              for (var i = 0; i &lt; results[j].address_components.length; i++) {
  
                if (results[j].address_components[i].types[0] == "locality") {
                    //this is the object you are looking for
  
                   city = results[j].address_components[i];
               }
  
               if (results[j].address_components[i].types[0] == "administrative_area_level_1") {
  
                  //this is the object you are looking for
                  region = results[j].address_components[i];
  
              }
  
              if (results[j].address_components[i].types[0] == "country") {
  
                  //this is the object you are looking for
                  country = results[j].address_components[i];
              }
          }
  
              city=city.long_name;
              state=region.long_name;
              country=country.long_name;
  
              $("#_state").val(state);
              $("#_country").val(country);
              $("#_city").val(city);
          }
          else
                          alert("Unable to retrieve your address");
      });
  },
     function (positionError) {
      alert("Error: " + positionError.message);
     },
     {
      enableHighAccuracy: true,
      timeout: 10 * 1000 // 10 seconds
     }
  }
  </code></pre>