Weather App with Simpleweather.js problems

Hi,
I was unable to figure out why my weather app only works in codepen and only on Mozilla and IE. Codepen does not work if I run it in Chrome. If I run locally it works but does not display the weather icon. I am bashing my head for few days now. Can someone can give an advise?! Ive been using the http://simpleweatherjs.com/. Thank you!
Here is my draft
http://codepen.io/andreyivanov86/pen/BWbbMK.

First of all, I was getting some errors in the console for linking to style sheets. You html contains:

<link rel="stylesheet" href="css/style.css">

That is how you link to your style.css in a real web page, but remember that codepen links to your css automatically and this path just confuses it.

Next, I think that navigator.geolocation is problematic because it is htpps and codepen isn’t. I used this instead:

  $.getJSON("http://ip-api.com/json", function (data) {
    lat = data.lat;
    lon = data.lon;
/* continue with your code */

… or however you need to implement it.

1 Like

Can you elaborate on that more because I am using the JSON method but it isn’t really working in my favor and kinda making the whole thing worse

Here is a link to my project https://codepen.io/ahenry890/pen/bqXPNL?editors=1010

Help would be very much appreciated from anybody who knows about simpleweather.js