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 using JS - Fetch API

#fetch
Thih_Nezzy 180

@nobody1234455

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

Solution retrospective


Hi there, Frontend Community I'm in trouble with JS when I make an API call. Can anybody tell me how I can handle delays after calling the API using fetch?

Community feedback

Shiva 670

@shivaprakash-sudo

Posted

Hello Thih_Nezzy,

The Advice API caches the data for 2 seconds, which is why you're having delays in responses. You can avoid the caching using the following code, as a second argument to the fetch method. { cache: "no-cache" }

Let me know if it doesn't solve the problem.

Marked as helpful

2

mozero 20

@alpha0zero

Posted

@shivaprakash-sudo that's it brother

0
Thih_Nezzy 180

@nobody1234455

Posted

@shivaprakash-sudo I solved it bro! Thanks a lot.

1
Shiva 670

@shivaprakash-sudo

Posted

@nobody1234455 You're welcome!

0

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