assets/script.js
//functions to display information from the fetch
functions to display information from the fetch
functions to display information from the fetch
function showWeather(cityName, data) {
        var dateCurrent = new Date(data.dt *1000);
        var conditions = data.weather[0].main;
        var temperature = data.main.temp;
        var humidity = data.main.humidity;
        var windSpeed = data.wind.speed;
        var currentCity = data.name;
        iconEl.src =
        "https://openweathermap.org/img/wn/" + data.weather[0].icon + "@2x.png";
        descriptionEl.textContent = conditions;
        temperatureEl.textContent = temperature + "°";
        humidityEl.textContent = humidity + "%";
        windSpeedEl.textContent = windSpeed + " mph";
        cityEl.textContent = currentCity;
        dateEl.textContent = dateCurrent;
    }
function showWeather ( cityName , data ) { var dateCurrent = new Date ( data . dt * 1000 ) ; var conditions = data . weather [ 0 ] . main ; var temperature = data . main . temp ; var humidity = data . main . humidity ; var windSpeed = data . wind . speed ; var currentCity = data . name ; iconEl . src = "https://openweathermap.org/img/wn/" + data . weather [ 0 ] . icon + "@2x.png" ; descriptionEl . textContent = conditions ; temperatureEl . textContent = temperature + "°"; humidityEl . textContent = humidity + "%" ; windSpeedEl . textContent = windSpeed + " mph" ; cityEl . textContent = currentCity ; dateEl . textContent = dateCurrent ; }
functions to display information from the fetch
functions to display information from the fetch
// console.log(temperature);