My Weather Application Feedback

My Weather Application Feedback
0.0 0

#1

I just finished my first draft of my Weather Application and was wanting to receive feedback on how I did and whether my code is readable and appropriate.
Let me know!
Thank you!

Here is the link to the pen:


#2

Its ok. The only thing i think you should change is setInterval(setWeatherData, 1000 * 30) that force the app to refresh every 30 secs. The weather api return forecast hourly. If your intention was just to adjust only the time then you should make a function to update only the time.

I would also show the user location that is missing.


#3

It’s good. But I think you can break your setWeatherData() into more manageable pieces.

Since you are using AJAX you can refactor the code to have a standalone AJAX GET request to handle the Requests with a callback .

Also, I see “document.getElementById(‘temperature’)” been repeated. You can set this into a variable var temperature = document.getElementById('temperature') and then call it.

Hope this works.


#4

:clap::clap: Nice work i think making the functions in setWeatherData standalone functions will make the code more readable. Cheers!!