FreeCodeCamp´s weather API location errors. Anyone else?

Hi

I have been working on the local weather challenge for a while using FreeCodeCamp’s weather API and found that rather often it does not find my location correctly.

Let me explain:

the codepen does work. but every now and then the API seems to decide I am in japan rather than the UK.

Has anyone else encountered this problem as well?

Also, I found that one specific parameter (the location… again!!) loads perfectly when using a button, but does not normally load when loading the pen itself. I am puzzled as why this is happening, since the button executes the same function as the pen when loading.

Here you have link to my pen.

https://codepen.io/Graventh/full/vpMJpm/

(Sorry for the ugly looking style… I have been focusing on the functionality so far)

Thank you for your help!!

OK, I think I get it now. I am used to coding that executes sequentially instead of simultaneously. I didn´t think about the possibility of the two functions executing at the same time!!

Thank you, for the explanation! Everything makes much more sense now.