Weather app: changing units

Weather app: changing units
0

#1

In the following pen, when i click on C/F the units of the current temperature changes successfully, however, when i want the units of the temperature units of the forecast box to change as well. In my current code, i have tried to do that in line # 69 and #139 (separately). Why doesn’t it work and what can i do to fix it?


#2

It seems to work now. Did you figure it out? The app looks great otherwise, but when you use ES6 in CodePen, you need to use the Babel precompiler (it’s in the same place you include jQuery and other external resources).


#3

I actually aborted the way i was approaching the problem. See all the lines of commented code in class="forecast-weather-box" and the second getJSON request? I originally wanted to render every element in the forecast box in separate divs so that when i changed the unit, only the max and min temperatures (among all the different elements in the forecast box) were changed, now i have to reload the entire forecast box. I couldn’t figure out how to do it. I guess i was messed up with the scoping. It’s only when one does projects does one understand how confusing scoping can be.