Design comparison
Solution retrospective
Do you know why my generate function doesn't work on Firefox (a second time) ?
Community feedback
- @JoannaLapaPosted over 2 years ago
Hi Martin!
My congrats for finishing the challange! Your solution looks pretty good!
Your problem makes me many troubles too. Apparently Firefox 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. You can also look how I resolve it in my project here: https://github.com/JoannaLapa/advice-app-challenge/blob/main/src/js/main.js
One suggestion concerning your JS file - it is a good practice to use const and let instead of var (in most cases the best choice is const). Const and let are the features that came with ES6. You can read more about the difference between them 3 here: https://www.freecodecamp.org/news/var-let-and-const-whats-the-difference/
I hope that it helps you! Happy coding! Joanna
Marked as helpful1 - @Harshi786Posted over 2 years ago
Hey!
- You need to fix the accessibility issue. Here is my suggestion:
Buttons must have discernible text
. set the aria-label attribute to describe button.<button aria-label="Advice Generator"></button>
Hope this helps :)
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