Yfaite commited on
Commit
0df9153
·
verified ·
1 Parent(s): 83e924a

THe search button is not working solve it

Browse files
Files changed (1) hide show
  1. 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
- // Update UI with current weather
174
- updateCurrentWeather(currentWeatherData);
 
175
 
176
  // Update UI with forecast
177
- updateForecast(forecastData);
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();