Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Advice generator

Adarsh 1,560

@adram3l3ch

Desktop design screenshot for the Advice generator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
2junior
View challenge

Design comparison


SolutionDesign

Community feedback

@debriks

Posted

Hi Adarsh,

You're clearly better than I am at Javacript but I noticed that you have the same problem I had on your Advice Generator App and I wanted to share with you the fix I found on stackoverflow, maybe you will find it useful.

In your app, you have to push twice the button to get a new advice, it takes a bit of delay. It is because of the cache (there's actually a note about it on the API website : Advice is cached for 2 seconds. Any repeat-request within 2 seconds will return the same piece of advice).

I fixed this small issue by simply adding { cache: "no-cache" } to the API response like so:

const response = await fetch(END_POINT, { cache: "no-cache" });

Hope you will find this useful.

Happy coding!!

Marked as helpful

1
vishwa3 250

@vishwa3

Posted

Loved the blur effect on the advice message - have implemented the same in my solution

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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