How can I use Open Weather APp for my project?

Hello everyone!
I’m working on Show the Local Weather challenge.

How can I get temperature of my location from the Open Weather Map?
Here’s my code below.

    function weather() {

        var location = document.getElementById("location");
        var apiKey = '****************************************'; 
        var url = 'http://api.openweathermap.org/data/2.5/weather';

        navigator.geolocation.getCurrentPosition(success, error);

        function success(position) {
          latitude = position.coords.latitude;
          longitude = position.coords.longitude;

          location.innerHTML = 'Latitude is ' + latitude + '° Longitude is ' + longitude + '°';

           $.getJSON(url + "&appid=" + apiKey + "/" + latitude + "," + longitude + "?callback=?", function(data) {
            $('#temp').html(data.currently.temperature + '° F');
            $('#minutely').html(data.minutely.summary);
          });
        }

        function error() {
          location.innerHTML = "Unable to retrieve your location";
        }

        location.innerHTML = "Locating...";
      }

      weather();

Thank you for your help!

Here is what I used:

$("body").on("keyup", "#location", function() {
  var APIKEY = "************************"
  // This is the value you get from an input and it auto updates as you type.
  var location = $('#location').val();
  ///////////////////
  var url = 'http://api.openweathermap.org/data/2.5/weather?q=' + location + '&appid=' + APIKEY+ '&units=imperial';
  $.getJSON(url, function(data) {
    $('#temp').html(data.main.temp);
  });
});

You should take a look at the WeatherUnderground API it comes with an autoip feature builtin.

o