Can someome tell my why this worked yesterday and now it doesn't?

Can someome tell my why this worked yesterday and now it doesn't?
0

#1

Here’s the code.

More specifically, this worked yesterday:

$.getJSON("http://ip-api.com/json", function(data){
  
  var lat = (data.lat).toString();
  var lon = (data.lon).toString();
  
  $.getJSON("http://api.openweathermap.org/data/2.5/weather?lat="+lat+"&lon="+lon+"&appid=c1861af0f1d14e3ec3312991a6a44847", function(result){
    $(".loc").html(result.name);
    $(".temp").html((result.main.temp-273.15).toFixed(2));
    $(".stat").html(result.weather[0].main);
 });

And now it doesn’t. I swear I didn’t touch a single character of the code. It just has stopped working for no reason. I’ve tried this and this, and both are returning values but for some magical reason now my code doesn’t work.

I didn’t touch anything, the servers are returning the correct data, and something that worked yesterday today it doesn’t.


#2

Check the error console:

This means that you can’t call a http resource from a https origin. Change the codepen url to http://codepen.io/Inhert/pen/MjMrpb and it works fine :slight_smile:


#3

I love you :kissing_closed_eyes:


#4

:blush: Aw, shucks :blush: