getJSON callback not successful

getJSON callback not successful
0.0 0

#1

My callback isn’t working and I can’t see why. I’ve tested the URL and that works fine. Can anyone spot whats wrong?

   function getWeather(c,r){
  
  $.getJSON("api.openweathermap.org/data/2.5/weather?q=London&units=metric&APPID=09d1d2672d1bedcb1e31be0fa0b459fa", function(data) {
    console.log("test")
  
  });
}

#2

Hi @EndaMolloy

You need prepend http like so: http://api.openweathermap.org/...

What it’s doing at the moment is seeing that as a relative path and doing something like: codepen.io/{...}/api.openweathermap.org/{...}


#3

Such a silly oversight, thank you