Random Quote Machine pen breaks after a while

Hi, I did the Random Quote Machine webpage with all it’s functionalities, it was working perfectly but after a while I reopened the pen and now the page it’s broken.

  • I tried to copy the code to a new pen but not even the css works as it should there.
  • Searched the web to see if I could find something about it but no luck.
  • I also did it again, from zero, but this keeps happening (when I save it works but then is broken)

What can it be?

This is the pen https://codepen.io/fzanollo/pen/apqJwa

Thanks for your help

Hi !

You are loading code pen over https but try to make a request over http.
The browser prevents mixed content calls and block it (check you dev tools (if you’re on Chrome) / console).

Load your codepen over http:
http://codepen.io/fzanollo/pen/apqJwa3

or fix that function:

function getQuote(){
$.getJSON("http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?")
.done(update)
.fail(handleErr);
}

to make an AJAX call to https site.

By “fix” I mean either check if “api.forismatic.com” serves content over https and make https call or find and another API serving quotes over https.

Best regards,
Jarosław Pawlak

Thank you very very much! :smile: