Submitted over 1 year ago
Responsive advice generator that fetchs an API
@alexgabriel8
Design comparison
SolutionDesign
Solution retrospective
I accept any kind of feedback!
EDIT: Ignore the paragraph below, people already helped me fix my problem with Firefox!
Also I would like to know why my page ins't working correctly on Firefox. The page shows me an advice, but does not let me get another one.
Community feedback
- @zougari47Posted over 1 year ago
Try this
fetch('https://api.adviceslip.com/advice', { cache: 'no-cache' })
Marked as helpful1 - @HectorMartinDamaPosted over 1 year ago
Hello @alexgabriel8, in your request to the api use this:
fetch('https://api.adviceslip.com/advice/' + Math.floor(Math.random() * 200))
The random number is because if you do not indicate a specific advice, it does not work correctly, in your project change the advice when you click in the button five times
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