THe search button is not working solve it
Browse files- index.html +7 -8
index.html
CHANGED
|
@@ -170,13 +170,13 @@
|
|
| 170 |
if (!weatherData.current_weather || !weatherData.daily) {
|
| 171 |
throw new Error('Incomplete weather data received');
|
| 172 |
}
|
| 173 |
-
|
| 174 |
-
|
|
|
|
| 175 |
|
| 176 |
// Update UI with forecast
|
| 177 |
-
updateForecast(
|
| 178 |
-
|
| 179 |
-
// Hide loading, show weather
|
| 180 |
document.getElementById('loading').classList.add('hidden');
|
| 181 |
document.getElementById('current-weather').classList.remove('hidden');
|
| 182 |
document.getElementById('forecast-container').classList.remove('hidden');
|
|
@@ -266,9 +266,8 @@
|
|
| 266 |
</div>
|
| 267 |
`;
|
| 268 |
forecastContainer.appendChild(forecastItem);
|
| 269 |
-
}
|
| 270 |
-
|
| 271 |
-
// Example: Load default weather for London on page load (more reliable)
|
| 272 |
window.addEventListener('load', () => {
|
| 273 |
document.getElementById('location-input').value = 'London, UK';
|
| 274 |
fetchWeather();
|
|
|
|
| 170 |
if (!weatherData.current_weather || !weatherData.daily) {
|
| 171 |
throw new Error('Incomplete weather data received');
|
| 172 |
}
|
| 173 |
+
|
| 174 |
+
// Update UI with current weather
|
| 175 |
+
updateCurrentWeather(weatherData);
|
| 176 |
|
| 177 |
// Update UI with forecast
|
| 178 |
+
updateForecast(weatherData);
|
| 179 |
+
// Hide loading, show weather
|
|
|
|
| 180 |
document.getElementById('loading').classList.add('hidden');
|
| 181 |
document.getElementById('current-weather').classList.remove('hidden');
|
| 182 |
document.getElementById('forecast-container').classList.remove('hidden');
|
|
|
|
| 266 |
</div>
|
| 267 |
`;
|
| 268 |
forecastContainer.appendChild(forecastItem);
|
| 269 |
+
}
|
| 270 |
+
// Example: Load default weather for London on page load (more reliable)
|
|
|
|
| 271 |
window.addEventListener('load', () => {
|
| 272 |
document.getElementById('location-input').value = 'London, UK';
|
| 273 |
fetchWeather();
|