I finished my weather app a little while ago, but have gone back to it to try and fix a bug. I’m stumped.
The bug is that the temp and speed units switches stop working on a search (keystroke or go button) or a locate via the locate button. They then start to work again if I perform either of those actions.
Things i’ve tried:
I tried wrapping the toggle setup in a function and calling it when page is fully populated. Currently its in a code block with the rest of the data parse called populate().
Moving the switch setup into the doc ready section at the top (whilst wrapped in function) with the other buttons
Removing doc ready altogether
Changing the lines within the switch setup to pure jquery as it is a bit of a mix of jquery and js.
None of these things worked so I didn’t commit, what you see on github is as it was. I’m in the process of writing a load of console logs into the app so will commit that instead when done.
Current js on github, the switch set up is right at the bottom.
Many thanks if you can find the time to take a look for me.