I’ve finally finished the basic functionality of my quote machine, but I have a problem which I haven’t been able to solve. I can’t seem to find a solution in the forum or elsewhere either. The code works ok, but sometimes the quote won’t load. This happens both at page load/refresh, and on button click. Could anyone help me figure this out? I realize that we should probably use an API for this, and that will be my next task, but I would still like to understand why this is happening.
Pen link: https://codepen.io/cestbalez/pen/zPPzzm
Thanks for any help.