Random quote generator not working on CodePen

Random quote generator not working on CodePen
0

#1

Hi Guys, I am doing my front end first project , my random quotes are not working on CodePen while working fine on my computer. I think , I am missing something to link , I have linked all files and external links as well but still no success.

Please let me know why its not working ?
Here is the CodePen link;

https://codepen.io/azambadar/pen/qyJeGy

Many thanks


#2

Always check your browser’s console when something isn’t working. It will probably give you a useful error.

In this case, it’s an issue because the Forismatic API is not secure (HTTP) and CodePen is (HTTPS). The easiest fix is to use a CORS proxy. I like cors-anywhere. You simply prepend the API endpoint with the proxy’s:

https://cors-anywhere.herokuapp.com/http://api.forismatic.com/api/1.0/?method=getQuote&key=457653&format=jsonp&lang=en&jsonp=?