mercredi 22 avril 2015

Pull Weather API Data Using JSON and append to li's?

I am having trouble figuring out how to pull OpenWeatherMap API data and append it to corresponding li's in my html. Thanks for your help, I am stuck right now with the following code:

<!doctype html>
<html lang="en">
  <meta charset="utf-8">
  <title>Project 21</title>
    html {margin:2em; font-size:2em; font-family:Helvetica, Arial, sans-serif;}
    h1 {margin:0 0 0.2em; color:#369;}
    img {float:left; margin-right:1em;}
    ul {float:left; margin:0; padding:0; list-style:none;}
  <script src=""></script>
    <h1>Current Weather for </h1>
    <div class="img" id="data-img"></div>
      <li><b>Conditions:</b> <span id="data-current"></span></li>
      <li><b>Temperature:</b> <span id="data-temp"></span>&deg;</li>
      <li><b>Humidity:</b> <span id="data-humidity"></span>%</li>
      <li><b>Wind Speed:</b> <span id="data-wind"></span>mph</li>
  { 'zip': '46556,us', 'units':'imperial' },
  .fail(function(jqxhr, textStatus, error) {
    console.log("Request Failed"+ textStatus + "," + error);


Aucun commentaire:

Enregistrer un commentaire