Weather Project API Help needed (Codepen not working?)

Weather Project API Help needed (Codepen not working?)
0.0 0

#1

Hey guys I have been working on the weather API project and my problem is I don’t think my codepen is working when I try to console.log or HTML display my weather data. Can you guys check my codepen to see if the console or html display is working? There isn’t a point of continuing this project if I can’t see any of my information and I have been stuck on this for a while so thank you.

Code Pen Link

Also what development environment would you recommend to someone working on the front end certification course on FCC so I don’t have to rely on codepen?

Thank you for your time :blush:


#2

There seems to be a lot wrong with your code that has nothing to do with CodePen.

I would suggest going carefully through your code to troubleshoot exactly what is wrong, because the console was working fine for me when I started reworking some of your code.


#3

You declared a function called getCoordinates, but I do not see where you call it.

Also, you do not need the https://crossorigin.me/ prefixed to your api url. However, you need to make sure there are no spaces in your url string.

There actually is a Codepen issue with respect to calling the navigator.geolocation.getCurrentPosition multiple times in the same session. For some reason lately, after the first call, extra calls take anywhere from 5 to 20 seconds to work, so you have to give it a few minutes if you are doing multiple page refreshes.

Github Pages

surge.sh