I’ve read quite a few articles and stack-overflow questions and I still cannot get my random quote generator to deal with the ‘insecure request’ error that I’m seeing. The URL I’m using works in an endpoint tester, like Postman. However, when using a web based compiler, like codepen, I get the following error:
I’ve tried using ‘https’ instead and I get a CORS error.
cannot load https://quotesondesign.com/wp-jsonp=?/posts?filter[orderby]=rand&filter[posts_per_page]=1. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://s.codepen.io' is therefore not allowed access. The response had HTTP status code 404.
I added ‘https://crossorigin.me’ to the beginning of the URL, and switched to what appears to be a more stable endpoint and everything appears to be working, in codepen, at least. I’m doing a separate version in angular 1, just to compare the two back to back.