Random Quote Machine (Help with Retrieving Random Quotes)

  Hey guys if possible I could use some assistance with the Random Quote Machine Intermediate Project. My call to the API works, however, it receives the same quote with every call. Would I need to manipulate the jquery code (e.g. Math.random, for loop, etc) or change the URL specified in the getJSON function, or maybe something entirely different.
 Here is my code: [https://codepen.io/mmassie23/pen/YWZbYy](https://codepen.io/mmassie23/pen/YWZbYy). I am using the [Quotes On Design](https://quotesondesign.com/api-v4-0/) API. Any suggestions would be heavily appreciated and I also want to thank you for your time :smile:
2 Likes

See this post, should work for you as well.

2 Likes

Thank you very much it works! However, it only did so when I changed the URL from https - http. Would you happen to know why that is (sorry, just very curious)?

Most browser don’t allow http requests if your website uses https.

Oh I didn’t know that. Once again thanks you very much for your assistance.

I was about to write up my own thread to get feedback, and it gave me this to look at. I added the ajax line of code, and it works.

I am taking it that because it is caching the data its, then retrieving the cached data? Could you explain this to me?