Design comparison
Solution retrospective
The Advice Slip API does not give random advice in firefox but works in chrome. It's either firefox bug of API bug not sure. I have also tried a little work around for this problem, checkout my script.js file of this project in Github Repo, The commented out lines . Any suggestions are very welcome. Thanks!
Community feedback
- @JoannaLapaPosted over 2 years ago
Hi Mohit kalme!
My congrats for finishing the challange!
Your problem makes me many troubles too, but I resolved it. The browser by default looks for a matching request in its HTTP cache. If there is a match and it is fresh, it will be returned from the cache- so it takes the previous advice. You can read more in this article on mdn https://developer.mozilla.org/en-US/docs/Web/API/Request/cache You can resolve it by adding {cache: no-cache} just after the URL address like below: const res = await fetch(API_ENDPOINT, {cache: no-cache});
I hope that it helps you!
Marked as helpful1@mohitkalmePosted over 2 years ago@JoannaLapa Thank you. Your answer solved my problem
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord