QuoteMachine: Mixed Content Error


I am using the forismatic API to retrieve the Quotes. When I test my code on notepad, the code runs correctly. However, when I try the code on code pen I get a Mixed content Error. My code on codepen is here: https://codepen.io/Ag_Yog/pen/rzezYw.

When using inspect element I get these errors:

Thanks for any help


Use https for your Forismatic URL to fix this error:

  function getNewQuote(){
      url: 'https://api.forismatic.com/api/1.0/', // HTTPS prevents mixed-content


This is because your are requesting resource from an unsecured/remote domain.

if @SkyC method does not work, try using cross origin like this in your request url


I hope that works for you.

read more about cross origin here


CORS is not the same as Mixed Content and neither error is specific to CodePen.

@Ag_Yoge is using JSONP and the API supports HTTPS, so a proxy is not required luckily. These 3rd party proxies like cors-anywhere and crossorigin.me go down frequently and without notice.


What to do here now?


This worked for me:


Also remember to logon to Codepen using https://codepen.io


I m stuck on color change page. nothing is working out there. can u please help me?


Unfortunately I had no need for a colour change page in my project, so perhaps somebody else can help you. (I assume you are referring to the Random Quote project?)

Please look at some of the other forums as well.

Was your ‘Mixed Content Error’ resolved?