JSON request doesn't run associated function


#1

Hey, I’m working on my “Show the Local Weather” challenge, and I need some help. The function associated with the json request to get the weather just doesn’t run. Here’s the CodePen link if you’d like: Here

$(document).ready(function() {
  console.log("Loading Page...");
  navigator.geolocation.getCurrentPosition(function(position) {
    var lat = position.coords.latitude;
    console.log("lat: " + lat);
    var long = position.coords.longitude;
    console.log("long" + long);
    site = "https://api.darksky.net/forecast/be53896f50e562397d410b599514231b/" + lat + "," + long;
    console.log(site);
    $.getJSON(site, function(json) {
      console.log(json.currently.summary);
    });
  });
});

#2

I am having same issue. I can’t get the .getJSON request to send the request. Did you find a solution?


#3

Yeah, I used the URL “https://crossorigin.me/https://api.darksky.net/forecast/