Weather widget running in Firefox but not in Chrome or codepen

Hello

I finished the weather widget project, the issue, it is working only in Firefox but not on Chrome or codepen.

Change your http to https on your API call.

1 Like

thank you. it did the trick

but now the switch between F and C isn’t working even though it is locally ?

You are right again, I thought i changed it before, but i realized i changed the url of the weather icon .

The API only sends the temp either in metric C or in Kelvin or in imperial F, I can store the Temperature values and use a function to convert from C to F, that is a way of doing it if i don’t call the API again to grab the other unit.

What do you think about it ?

There is math equation to convert C to F and C to F


The FCC challange --> https://www.freecodecamp.org/challenges/convert-celsius-to-fahrenheit

The in-depth explanation --> https://www.mathsisfun.com/temperature-conversion.html


I forgot about it. Thank you :slight_smile:

function convertToF(celsius) {
  var fahrenheit;
  // Only change code below this line
  
  fahrenheit = celsius * 9/5 + 32;
  // Only change code above this line
  return fahrenheit;
}
1 Like