title: Forecast.io API Usage with jQuery
body: <p>I'm having some trouble creating a complete application using an API, specifically the Forecast.io weather api. For simplicity, I've put my JS directly in my HTML page. For this basic version, I would be happy just to have this show something. Let's say I wanted current temperature (currently -> temperature). Also, I'm not sure if "?callback?" is always recommended for all RESTful APIs.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;body&gt;  
      &lt;p id="weather"&gt;Here's the weather:&lt;p&gt;
  
      &lt;button onclick="b()"&gt;Submit&lt;/button&gt;
          &lt;script&gt;
  
          function b(){
  
              var apiKey = '&lt;private&gt;';
              var url = 'https://api.forecast.io/forecast/';
              var lati = 0;
              var longi = 0;
              var data;
  
              $.getJSON(url + apiKey + "/" + lati + "," + longi + "?callback=?", function(data) {
                $('#weather').innerHTML('and the weather is: ' + data[4].temperature);
              });
          }
          &lt;/script&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>