function renderCards(dayData) {
    cards.each(function (cardIndex) {
        var dataIndex = cardIndex + 1;
        var cardUnix = dayData.daily[dataIndex].dt;
        var cardDate = moment.unix(cardUnix).format("MM/DD/YYYY");
        $(this).find("h5").text(cardDate);

        var cardIcon = dayData.daily[dataIndex].weather[0].icon;
        var iconAlt = dayData.daily[dataIndex].weather[0].description;
        var cardIconURL = "http://openweathermap.org/img/wn/" + cardIcon + "@2x.png";
        var imageDiv = $(this).find(".fiveDayImage");
        imageDiv.empty();
        var imageTag = $("<img>").attr("src", cardIconURL).attr("alt", iconAlt);
        imageDiv.append(imageTag);

        var cardTemp = dayData.daily[dataIndex].temp.day;
        $(this).find(".cardTemp").html("Temp: " + cardTemp + "&deg;");

        var cardHumid = dayData.daily[dataIndex].humidity + "%";
        $(this).find(".cardHum").text("Humidity: " + cardHumid);
    });
}
// Function to display future weather in cards
Function to display future weather in cards
Function to display future weather in cards
function renderCards(dayData) {
    cards.each(function (cardIndex) {
        var dataIndex = cardIndex + 1;
        var cardUnix = dayData.daily[dataIndex].dt;
        var cardDate = moment.unix(cardUnix).format("MM/DD/YYYY");
        $(this).find("h5").text(cardDate);
        var cardIcon = dayData.daily[dataIndex].weather[0].icon;
        var iconAlt = dayData.daily[dataIndex].weather[0].description;
        var cardIconURL = "http://openweathermap.org/img/wn/" + cardIcon + "@2x.png";
        var imageDiv = $(this).find(".fiveDayImage");
        imageDiv.empty();
        var imageTag = $("<img>").attr("src", cardIconURL).attr("alt", iconAlt);
        imageDiv.append(imageTag);
        var cardTemp = dayData.daily[dataIndex].temp.day;
        $(this).find(".cardTemp").html("Temp: " + cardTemp + "&deg;");
        var cardHumid = dayData.daily[dataIndex].humidity + "%";
        $(this).find(".cardHum").text("Humidity: " + cardHumid);
    });
}
function renderCards ( dayData ) { cards . each ( function ( cardIndex ) { var dataIndex = cardIndex + 1 ; var cardUnix = dayData . daily [ dataIndex ] . dt ; var cardDate = moment . unix ( cardUnix ) . format ( "MM/DD/YYYY" ) ; $ ( this ) . find ( "h5" ) . text ( cardDate ) ; var cardIcon = dayData . daily [ dataIndex ] . weather [ 0 ] . icon ; var iconAlt = dayData . daily [ dataIndex ] . weather [ 0 ] . description ; var cardIconURL = "http://openweathermap.org/img/wn/" + cardIcon + "@2x.png" ; var imageDiv = $ ( this ) . find ( ".fiveDayImage" ) ; imageDiv . empty ( ) ; var imageTag = $ ( "<img>" ) . attr ( "src" , cardIconURL ) . attr ( "alt" , iconAlt ) ; imageDiv . append ( imageTag ) ; var cardTemp = dayData . daily [ dataIndex ] . temp . day ; $ ( this ) . find ( ".cardTemp" ) . html ( "Temp: " + cardTemp + "&deg;" ) ; var cardHumid = dayData . daily [ dataIndex ] . humidity + "%" ; $ ( this ) . find ( ".cardHum" ) . text ( "Humidity: " + cardHumid ) ; } ) ; }
Function to display future weather in cards
Function to display future weather in cards