Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

99
Views
OpenWeather API endpoint fetch

https://javascript.plainenglish.io/display-7-day-weather-forecast-with-openweather-api-aac8ba21c9e3

I'm having trouble implementing this into my project. I can't get it to display weather on the page. I believe I need to render it to the page?

    forecastEl[0].classList.add('loaded');

    response.json().then(function (data) {
        var fday = "";
        data.daily.forEach((value, index) => {
            if (index > 0) {
                var dayname = new Date(value.dt * 1000).toLocaleDateString("en", {
                    weekday: "long",
                });
                var icon = value.weather[0].icon;
                var temp = value.temp.day.toFixed(0);
                fday = `<div class="forecast-day">
                    <p>${dayname}</p>
                    <p><span class="ico-${icon}" title="${icon}"></span></p>
                    <div class="forecast-day--temp">${temp}<sup>°C</sup></div>
                </div>`;
                forecastEl[0].insertAdjacentHTML('beforeend', fday);
            }
        });
    });

Thank you!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!