Relative Content

Tag Archive for javascripthtmlcssapi

I want to include the API from weatherOpenMap in my website to show the weather dynamic icon based of that but it doesn’t show up

I included this in my html header : <script src=”main.js”></script> and this is in my weather section : <div class=”weatherIcon”> <h2><span id=”weather-icon”>weather icon…</span></h2> </div> and this is in my javascript file (main.js) : const getWeather = async () => { try { const response = await fetch(‘https://api.openweathermap.org/data/2.5/weather?q=gothenburg,se&APPID=c95f90301395e8ce1cb18d910cd184cb’); const data = await response.json(); const weatherCondition = […]