Design comparison
SolutionDesign
Solution retrospective
Thanks
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hi there ๐. Good job on completing the challenge ! I have some feedback for you if you want to improve your code.
- Use the
<main>
tag to wrap all the main content of the page instead of the<div class="card">
tag. With this semantic element you can improve the accessibility of your page.
- There isn't much information about what the button is for. You can use a
aria-label with
Generate new advice
to announce to users with screen readers that the button functionality
-
The Advice Slip JSON API documentation says that the repeat requests within 2 seconds will return the same response. You have two options to solve this problem:
- Use the
cache: no-cache
option in thefetch
function to receive a new response every time:fetch(your_url, { cache: "no-cache" })
and use thesetTimeout
function to prevent the user from spamming the button. - Block the button and with the
setTimeout
function enable the button again after 2 seconds.
- Use the
- You should use the
cursor: pointer
property to indicate that the element like a button or a link is clickable.
I hope you find it useful! ๐ Above all, the solution you submitted is great!
Happy coding!
Marked as helpful0@other-wanPosted almost 2 years ago@MelvinAguilar Thanks for the tips. Great job sir.
0@BekEsalyPosted almost 2 years ago@MelvinAguilar Many thanks for your usefull advices and support. I've changed my code... Your tips are very usefull for beginners like me
0 - Use the
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