Show The Local Weather help

Show The Local Weather help
0

#1

Hello all, looking for a little help with the weather app project. I’ve tried several different ways and can’t get it to work. My most recent attempt is this one https://codepen.io/MarcelPenn/pen/EbOmjW?editors=0001 I followed along a youtube video and still can’t seem to get it lol. I’ve tried the api call on on it’s own and it works, so not sure what the problem is. Any help would be very much appreciated!

Marcel


#2

Look at your browser’s console (Ctrl+Shft+J in Chome) and you will see an error which needs to be corrected first.


#3

Then, you need to look at your id names in your html. Ids in the html should not start with #. That syntax is just for the css section.


#4

Ok I see it now, thanks. Do you know if there’s a work around? I think I would have to pay to access their https API…


#5

Just change the the http to https. There is no charge that I am aware of.


#6

Oh yeah, silly mistake in the html, thanks!


#7

I tried to remove the S from https but as soon I reload It switches right back haha


#8

If you use:

$.getJSON("https://api.openweathermap.org/data/2.5/weather?units=imperial&lat=" + loc[0] + "&lon=" + loc[1] + "&APPID=" + API_KEY, function(wd) {

it will work.


#9

Thanks! I’m getting most of the data now just have to fix up some of the html still I guess, so I should get it from here. Appreciate the help