Must be one of those days…
I ran into another problem and getting now displayed a 404 error in the preview (see screenshot below) - also on the chromium based browser where the previous problem didn’t appear. There was a recent post mentioning the same error, but I am unsure whether this has been resolved. My error appeared instantly on the first try, though.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Weather App</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="Your reliable Weather App" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<main>
<div>
<select>
<option value="">Please enter a city...</option>
<option value="new york">New York</option>
<option value="los angeles">Los Angeles</option>
<option value="chicago">Chicago</option>
<option value="paris">Paris</option>
<option value="tokyo">Tokyo</option>
<option value="london">London</option>
</select>
<button id="get-weather-btn">Get Weather</button>
</div>
<div>
<div><img id="weather-icon" src=""/></div>
<div id="main-temperature"></div>
<div id="feels-like"></div>
<div id="humidity"></div>
<div id="wind"></div>
<div id="wind-gust"></div>
<div id="weather-main"></div>
<div id="location"></div>
</div>
</main>
<script src="script.js"></script>
</body>
</html>
const weatherIcon = document.getElementById('weather-icon');
const mainTemp = document.getElementById('main-temperature');
const feeledTemp = document.getElementById('feels-like');
const humidity = document.getElementById('humidity');
const wind = document.getElementById('wind');
const gust = document.getElementById('wind-gust');
const weatherMain = document.getElementById('weather-main');
const location = document.getElementById('location');
const btn = document.getElementById('weather-btn');
async function getWeather(city) {
try {
let response = await fetch(`https://weather-proxy.freecodecamp.rock/api/city/${city}`);
let data = await response.json();
console.log(data);
return data;
}
catch(err) {
console.log('An error occurred during the fetching request...', err)
alert('Something went wrong, please try again later');
}
}
const showWeather = (city) => {
}
Is this due to my code?
