Issues with weather app

Issues with weather app
0

#1

Hey everyone,

I’ve been struggling to get my geolocation services to work on my local weather project.

I’ve made sure to use https to make sure it’s on a secure server and both Chrome and Safari ask for my location but neither works properly when it comes to showing my location.

It does however work when I run the code on a local server.

Could someone please take a look at my code and see if/what I’ve done wrong.

Here’s the link to my code: https://codepen.io/GeorgeMort/full/LWpXPZ/

As I said above, I don’t believe it has anything to do with https because I’ve been using that and it’s still not working.

Thank you for your help.


#2

Open developer console and you’ll see a 'Mixed Content` error:

Mixed Content: The page at ‘https://codepen.io/GeorgeMort/full/LWpXPZ/’ was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ‘http://api.openweathermap.org/data/2.5/weather?lat=56.8147355&lon=24.6044555&APPID=b1cf33a887983561feeb88f129df2944’. This request has been blocked; the content must be served over HTTPS.