# Random Quote Generator... why doesn't it work in codepen?

**URL:** <https://forum.freecodecamp.org/t/random-quote-generator-why-doesnt-it-work-in-codepen/99911>\
**Category:** General\
**Created:** [March 25, 2017, 7:30pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-why-doesnt-it-work-in-codepen/99911 "2017-03-25T19:30:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbrouse34](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@pbrouse34](https://forum.freecodecamp.org/u/pbrouse34)\
**Post date:** [March 25, 2017, 7:30pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-why-doesnt-it-work-in-codepen/99911/1 "2017-03-25T19:30:28Z")

</div>

So I’m trying to finish up the random quote generator and I have it working perfectly when I run it locally. I prefer to work with Sublime Text rather than directly in codepen so I typically do all of my coding there then copy/paste my html, css, and js into the corresponding sections of codepen.

Anyway, I’ve got my quote generator working flawlessly when I run my index.html directly in my browser. However, when I do it through codepen it does not display my quotes. Everything displays correctly as far as colors, buttons, etc but the quotes aren’t generating. I even copy/pasted the stuff in my head section on my local document into the head section of codepen.

[my pen](https://codepen.io/pbrouse34/pen/PpaGYo)

Any ideas? It’s getting a bit frustrating that I finally got everything to work but something just isn’t jiving in codepen.

---

<div class="post-metadata">

**Author:** ![rickstewart](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/rickstewart/32/66490_2.png) [@rickstewart](https://forum.freecodecamp.org/u/rickstewart)\
**Post date:** [March 25, 2017, 7:48pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-why-doesnt-it-work-in-codepen/99911/2 "2017-03-25T19:48:44Z")

</div>

Open up you pen in full screen viewing mode, and also open up your browser’s developer tools and try to get a quote. You’ll see something like the following:

Mixed Content: The page at ‘[https://codepen.io/pbrouse34/full/PpaGYo/](https://codepen.io/pbrouse34/full/PpaGYo/)’ was loaded over HTTPS, but requested an insecure script ‘[http://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=jQuery31005630235496941358\_1490470908991&\_=1490470908992](http://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=jQuery31005630235496941358_1490470908991&_=1490470908992)’. This request has been blocked; the content must be served over HTTPS.

This [Google Developers Article](https://developers.google.com/web/fundamentals/security/prevent-mixed-content/fixing-mixed-content) will get you started in finding the answer. ( just to note people run into this frequently, and the FCC forums have a lot of posts on the issue if you do a search )

---

<div class="post-metadata">

**Author:** ![pbrouse34](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@pbrouse34](https://forum.freecodecamp.org/u/pbrouse34)\
**Post date:** [March 25, 2017, 8:27pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-why-doesnt-it-work-in-codepen/99911/3 "2017-03-25T20:27:00Z")

</div>

Ugh, I knew it was going to be something simple. Thanks.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:50pm UTC](https://forum.freecodecamp.org/t/random-quote-generator-why-doesnt-it-work-in-codepen/99911/4 "2021-01-17T20:50:05Z")

</div>

Closed on January 17, 2021, 8:50pm UTC


