title: When to use .ajax or .getJSON when calling API
body: <p>I am working with the openweather API and after looking at sample code, I sometimes will see API calls made such as this:</p>
  
  <pre><code>function getWeather(callback) {
      var weather = 'http://api.openweathermap.org/data/2.5/forecast?lat=51.5072&amp;lon=0.1275&amp;units=metric';
      $.ajax({
        dataType: "jsonp",
        url: weather,
        success: callback
      });
  }
  </code></pre>
  
  <p>But then occasionally I will see requests made using this method:</p>
  
  <pre><code>function gettingJSON(){
  document.write("jquery loaded");
  $.getJSON("api.openweathermap.org/data/2.5/weather?q=London&amp;APPID=ee6596241130f193adf1ba90e625cc10",function(json){
  document.write(json);
  }
  </code></pre>
  
  <p>What is the main difference between these methods and is one considered better or more efficient than the other?</p>