I was unable to get my own code to work so I started looking at other users’ pens on the forum and none of them work either, even though others have commented that it does. The only one that does is FCC’s example pen. It almost seems like a browser problem? I tried disabling some Chrome extensions like HTTPS everywhere, Ghostery, and UBlock Origin but it made no difference
Thank you! This link was a lifesaver!
I was stuck! I was not able to make the page work in codepen, because of the other API’s http request. It otherwise worked fine locally in my browser, outside codepen.
The other APIs are normally sending data over a HTTP (insecure) protocol.In our case, Codepen and github pages are both working on a secure protocol (HTTPS) so when you are using a secure protocol you should send and receive data via secure protocol only. I think this was made to ensure security
So, the APIs I found (forismatic etc) are using HTTP protocol, so it’s hard to send data over such network, and I think the hard way to get around this is to use a proxy or some other CORS like thing idk I’m new to this too!
I think most services would prefer to have a secure pipeline to the data if you’re building an app, so you can’t really fault them for blocking mix content. I think changing APIs is the fix.
I think other people used different APIs, depend on when you did the projects.I know I decided to not use a quote specific API, and instead just pull quotes from Wikiquotes. It took a lot more work to figure out how to leverage the mediaWiki API to do what I wanted, which is just to pull random quotes from people, but I think I also learned a lot more, I know it helped me immensely on the wikipedia viewer project just because I’ve already know how that API works
Yeah I just wanted to get the stupid thing working for now, but maybe when I’m not so frustrated later I’ll have a crack at doing it with a different method. It’s more fun that way
it won’t be as nice and tidy as simply requesting for a random quote, because of different categories, formatting, and the fact that you have to parse the content. I know I spent most of my time just figuring the stuff out rather than the page itself.
If you just want to get the app running, hard code your own JSON object of like 5 quotes from 5 different people and just work with that while you build the page. Get all the buttons and effects working because those processes work the same doesn’t matter where your data comes from.
I know that’s how some people finished that project, the user story didn’t force you to use an API, or say it can be the same random 5 quotes. Once you get the interface working nicely with your own data, then you know at least the frontend of your app works, then you can work on how to get data from other sources to play nicely with your app