Looking for some jQuery help for my Random Quote Generator

I’ve been working on my random quote generator and can’t seem to get it to work. It looks like it should be fine to me, but seems like the jQuery isn’t actually running at all, even though it is linked in the JS settings.

Here’s the Codepen link.

Any help/advice/feedback would be awesome!

This is a cross domain security issue. When you’re securely connected to your site (ie, https://codepen.io/…), your browser will block any attempt to send or receive data through an insecure connection (ie, http://api.forismatic.com/…). The easiest solution here is to use a proxy, https://crossorigin.me in particular. Here’s how you’d use it: https://crossorigin.me/http://api.forismatic.com/...

In the future, you’ll want to pick an API that is hosted securely. There aren’t a lot of free ones, but it’s worth looking.

You can use crossorigin, but in this case it is easier to simply use the http version of codepen. Or am I missing something? Anyway http://codepen.io/slally89/pen/zKXRoV works fine for me.

On your portfolio (and in all other cases as well) link to http://codepen.io/...

Yup, looks like that’s it! Now I just need to get it to show the author to show and get the tweet button to work and I’ll be good! Thanks for the help!

The problem with that is you’re demanding the user make concessions in order to use the app. Aside from the moral implications of requiring less security, it’s not likely anyone’s going to bother. Plus, it’s much less code to just add the proxy than to write the code that asks users to change to an insecure connection.

1 Like