function forecastDeck(city) {
      $(".card-deck").empty();
      var queryURL = "https://api.openweathermap.org/data/2.5/forecast?q=" + city + "&units=imperial&appid=bf44d6b9da075580825f81e2aa54cf78";
    
      $.ajax({
        url: queryURL,
        method: "GET",
      }).then(function (response) {
        for (var i = 0; i < response.list.length; i++) {
          if (response.list[i].dt_txt[12] === "2") {
          var cardDate = moment.unix(response.list[i].dt).format("MM/DD/YYYY");
          var cardIcon = response.list[i].weather[0].icon;
          var cardIconURL = "https://openweathermap.org/img/w/" + cardIcon + ".png";
          var cardTemp = response.list[i].main.temp;
          var cardHum =  response.list[i].main.humidity;
    
          $(".card-deck").append(
          `<div class="card" style="margin:4px; padding:4px;">
            <div class="card-body">
              <h5 class="card-date">${cardDate}</h5>
              <img class="card-icon" alt="forecast" src="${cardIconURL}">
              <p class="card-text">Temp:<br> ${cardTemp} \u00B0F</p>
            <p class="card-text">Humidity:<br> ${cardHum}%</p>
            </div>
          </div>`);
          }
        }
      });
    }
// Dynamically building the 5-Day forecast section
Dynamically building the 5-Day forecast section
Dynamically building the 5 - Day forecast section
function forecastDeck(city) {
      $(".card-deck").empty();
      var queryURL = "https://api.openweathermap.org/data/2.5/forecast?q=" + city + "&units=imperial&appid=bf44d6b9da075580825f81e2aa54cf78";
      $.ajax({
        url: queryURL,
        method: "GET",
      }).then(function (response) {
        for (var i = 0; i < response.list.length; i++) {
          if (response.list[i].dt_txt[12] === "2") {
          var cardDate = moment.unix(response.list[i].dt).format("MM/DD/YYYY");
          var cardIcon = response.list[i].weather[0].icon;
          var cardIconURL = "https://openweathermap.org/img/w/" + cardIcon + ".png";
          var cardTemp = response.list[i].main.temp;
          var cardHum =  response.list[i].main.humidity;
          $(".card-deck").append(
          `<div class="card" style="margin:4px; padding:4px;">
            <div class="card-body">
              <h5 class="card-date">${cardDate}</h5>
              <img class="card-icon" alt="forecast" src="${cardIconURL}">
              <p class="card-text">Temp:<br> ${cardTemp} \u00B0F</p>
            <p class="card-text">Humidity:<br> ${cardHum}%</p>
            </div>
          </div>`);
          }
        }
      });
    }
function forecastDeck ( city ) { $ ( ".card-deck" ) . empty ( ) ; var queryURL = "https://api.openweathermap.org/data/2.5/forecast?q=" + city + "&units=imperial&appid=bf44d6b9da075580825f81e2aa54cf78" ; $ . ajax ( { url : queryURL , method : "GET" , } ) . then ( function ( response ) { for ( var i = 0 ; i < response . list . length ; i ++ ) { if ( response . list [ i ] . dt_txt [ 12 ] === "2" ) { var cardDate = moment . unix ( response . list [ i ] . dt ) . format ( "MM/DD/YYYY" ) ; var cardIcon = response . list [ i ] . weather [ 0 ] . icon ; var cardIconURL = "https://openweathermap.org/img/w/" + cardIcon + ".png" ; var cardTemp = response . list [ i ] . main . temp ; var cardHum = response . list [ i ] . main . humidity ; $ ( ".card-deck" ) . append ( ` ${ cardDate } ${ cardIconURL } ${ cardTemp } \u00B0 ${ cardHum } ` ) ; } } } ) ; }
Dynamically building the 5-Day forecast section
Dynamically building the 5 - Day forecast section