title: My code not working on server but working on localhost
body: <p><a href="https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_geolocation" rel="nofollow noreferrer">Code not working on server want to find geo-location and store into database</a></p>
  
  <blockquote>
    <p>code not working on server want to find geo-location and store into a database it working properly on localhost its <a href="https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_geolocation" rel="nofollow noreferrer">w3school code.</a></p>
  </blockquote>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;p&gt;Click the button to get your coordinates.&lt;/p&gt;
  
  &lt;button onclick="getLocation()"&gt;Try It&lt;/button&gt;
  
  &lt;p id="demo"&gt;&lt;/p&gt;
  
  &lt;script&gt;
  var x = document.getElementById("demo");
  
  function getLocation() {
    if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(showPosition);
    } else { 
      x.innerHTML = "Geolocation is not supported by this browser.";
    }
  }
  
  function showPosition(position) {
    window.location = "position/?latitude="+position.coords.latitude+"&amp;longitude="+position.coords.longitude;
  }
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>