Design comparison
Solution retrospective
Most proud of learning how to use API
What challenges did you encounter, and how did you overcome them?I had some problems with the positioning of the main div, and responsive design, I just researched how to do it on the internet
What specific areas of your project would you like help with?I would love some help with responsive design
Community feedback
- @zxc-wPosted about 1 month ago
It's great that you managed to learn how to use API, well done.
I tried your live preview and found that, while the first click works, subsequent clicks don't change the advice.
The problem is that the browser often caches
GET
requests to optimize performance, so you need to prevent it from caching the result and get a fresh new response after each click.In your
fetch
function, you can pass an object as the second argument to manage that caching mechanism, for example using theno-cache
value.See examples and read more here: MDN
Marked as helpful1
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