So I have been working on my weather app project for some days now and I tried to lookup + understand all the API/JSON/JSONP stuff. But whenever I type my code on codepen, even the data of the geolocation doesn’t to show up!! Nothing that I type on my JS part seems to work. Only HTML. I’m stuck and I don’t know wha’t wrong with it.
What frustrates me more is that when I copy and paste other codes of other fellow campers on my codepen; it doesn’t work. But it works alll fine in the original codepens of their owners. I’m really confused!!
I would appreciate any help that will put me our of my frustration. Thank you!
The console part is empty. When I type console.log(“string”) outside of all the code it works fine in the console, but when I write console.log(data) inside the function(data) code to show my location/weather data on the console part, nothing appears
No, you should keep http, because if you load it over https and are using http URLs in your code, you’ll get a mixed content error.
It’s actually working for me (if I use http to load the page), but it didn’t work at first, because the URL you pasted here to your pen is using https.
Oh I didn’t kow about that. Thank you for the heads up
When I add “s” to my links in the code it doesn’t work again should I change the whole API source?