Weather App get JSON Help

Weather App get JSON Help
0.0 0

#1

Hi

I’m stuck on the Local Weather App and I can’t see what I’m doing incorrectly. Currently all I’m trying to do is test the getJSON request but the console message I’m receiving is 404 Not Found. I’ve copied the url from the Open Weather Website, created and inserted my ID but it just won’t work. Here is my code, hopefully someone can help:

$(document).ready(function() {

$("#h1").click(function(){

$.getJSON("api.openweathermap.org/data/2.5/weather?q=London,uk&APPID={my ID}", function(data){
    console.log(data);
});

});
});

Many Thanks


#2

Looks like the url is missing the protocol, e.i., http:// or https://


#3

Problem solved. Thank you for your help. In hindsight it seems like a glaringly obvious mistake to make :sweat:


#4

Don’t feel too bad about it…we’ve all been there a time or two and made those same simple mistakes :slight_smile: