Local Weather App - HTML Geolocation not working

Hi everyone, this is my first time posting and I hope it’s okay to ask for help here.

A week ago I had the functionality of my weatherapp working locally only to find out that the APIs I was using do not support HTTPS and code does not support HTTP. So doing it all over again.

Right now, I’m just trying to get HTML geolocation working, so the project is at a really early stage but I just can’t figure out what is wrong with my code.

Here is my codepen

The code that calls the geolocation code is in a function that is not called anywhere. Add geoFindMe(); at the bottom of your code.

Then there’s an error with setting #location's HTML. $('#location').html is a function, so you need to call it (and pass it the string).

Thanks a lot for your quick reply! :slight_smile:

That I call the function in HTML button onclick tag is not enough?
Where in the code do I have to enter geoFindMe() exactly?

And where do I need to call the location.html function?

Sorry for all the questions, but I feel I’m missing some important knowledge about structuring my JS and I really wanna learn it. :smiley:

Right after the very last closing brace will work.

You’ve already actually done it inside the error function. Just do the same in the success function.

Another tip: You can click the dropdown button at the upper right of the JS editor, then hit Tidy JS to arrange your code.

thanks so much for your help! :slight_smile: