Can't fetch Quotes for my Quote machine

guys can someone please explain why its not generating quotes

1 Like

If you open the browser console you will see the problem:

jquery.min.js:4 Mixed Content: The page at 'https://codepen.io/akshayca/pen/WjgwBe' was loaded over HTTPS, but requested an insecure script 'http://quotesondesign.com/wp-json/posts filter[orderby]=rand&filter[posts_per_page]=1&_jsonp=jQuery31105114768952538409_1499163821367&_=1499163821368'. This request has been blocked; the content must be served over HTTPS.

Nice design btw.

2 Likes

From the API docs:

If you’re using something like jQuery, it can use the content with it’s own fancy callback magic, like this:

$.getJSON(“http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=”, function(a) {
$(“body”).append(a[0].content + "

— " + a[0].title + “

”)
});

Then try attaching https://cors-anywhere.herokuapp.com/ at the beginning of your URL.

Thank you,:slight_smile:
But How do I solve this problem ?

True.

I didn’t know that you could use https://quotesondesign.com/