sgenio
1
Hi All I’m receiving thid error whenever I try to request data from https://api.darksky.net/forecast/[key]/[latitude],[longitude],[time]. Any Idea of how to solve it?
XMLHttpRequest cannot load https://api.darksky.net/forecast/1ebc4f10fafd250bc91ac56b44d8918c/13.2623749,-8.827219. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘https://s.codepen.io’ is therefore not allowed access.
The usual cross-origin safety measure/annoyance. Use JSONP if you can (try appending ?callback=? to the url).
sgenio
3
@lynxlynxlynx can you give me anexo example!?
See what I wrote in the parentheses and search this forum for more, as it pops up all the time.
sgenio
5
Thank you very much @lynxlynxlynx. It worked!
To echo sgenio thanks Iynxlynxlynx.
For others in the future… I found this tutorial on JSONP very helpful.