I completed the Quote Machine App except it’s not working correctly. I have used this API: https://quotesondesign.com/api-v4-0/
It says that this link: http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1
Should give me 1 random quote. It does but after I have this quote and call it again it’s the exact same quote.
Here is my CodePen: https://codepen.io/GeraltDieSocke/pen/OxXJJr
Can anyone tell me what’s going on?
The result is most likely cached.
Hey. quotesondesign caches its results, therefore you just need to set the cache for your call to false by adding the following in your JS:
Or, since you’re using jQuery 3, you could modify your
.getJSON like so:
var quote = a.content;
var title = a.title;
$(".title").html("-" + title);