title: How do I get geolocation in openweather API
body: <p>How do I get mu openweather API to work with geolocation? This is my current html code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;link rel="stylesheet" href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/bootstrap.css"&gt;
          &lt;link rel="stylesheet" href="main.css"&gt;
          &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script type='text/javascript' src='app.js'&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div class="jumbotron"&gt;
              &lt;button onclick="getLocation()"&gt;Get my location.&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) {
                      x.innerHTML = "Latitude: " + position.coords.latitude + 
                                    "&lt;br&gt;Longitude: " + position.coords.longitude;    
                  }
              &lt;/script&gt;
  
              &lt;p&gt;The weather outside is: &lt;/p&gt; 
              &lt;div class= "weather"&gt;
                  Oops.. there is no temperature available for your location right now.
              &lt;/div&gt;
          &lt;/div&gt;                                  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And my <code>JavaScript</code> code:</p>
  
  <pre><code>$(document).ready(function(){
      $.getJSON( "http://api.openweathermap.org/data/2.5/weather?q=Eindhoven&amp;appid=9334f947893792dcb9b2e2c05ae23eb0", function( data ) {
          $('.weather').html(Math.round(data.main.temp-273)+ ' degrees Celcius');
      });
  
  });
  </code></pre>
  
  <p>I got the weather in Eindhoven city working, but I want to be able to adjust it to the latitude and longitude.
  Can someone fix my code for me? And help me?</p>
  
  <p>I know it has something to do with this link: api.openweathermap.org/data/2.5/weather?lat={lat}&amp;lon={lon} but I don't know how to implement my own fount latitude and longitude in it...</p>