Design comparison
Community feedback
- @EmanueleGuriniPosted over 2 years ago
Hi Mirai, well done, but reload doesn't works on FireFox: seem that FF caching the fetch result.
I found this solution on StackOverflow (https://stackoverflow.com/questions/72567690/ui-is-not-updating-on-click-event-that-triggers-a-fetch-on-firefox-developer) but the problem is that property called count is always incremented by one, and, if you start a new session, advice is always the same in a row.
To avoid the same advice in a row, as you can see from my solution, I create a new Random number, and I use it only if my script detects firefox browser.
My solution: https://github.com/EmanueleGurini/js-advicegenerator/blob/master/js/main.js
ps. why am I using 224 as max number? Advices are 224. Ema
Marked as helpful0
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