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 App using Sass and Vanilla JavaScript

P
Andrija 510

@andrijaivkovic

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


This is my solution to this challenge. It was build using Sass, specifically SCSS syntax and Vanilla JavaScript.

The only problem I'm encountering is that the advice that is displayed isn't refreshed on Firefox when the dice button is clicked and it even persists when the page is reloaded. I'm aware of the API's rate limiting and I'm sure that is not the problem since it works just fine on Chrome.

If anyone knows the solution to the problem I'm facing or other, general, suggestions please feel free to leave your feedback. Thanks! :)

Community feedback

@KorniDoS

Posted

Hi! You did a great job working with async and await! I've faced the same issue recently with Firefox but not Chrome. The solution to this is including the cache:"no-store" property after the fetch URL: fetch('https://api.adviceslip.com/advice', {cache: "no-store"}).

Marked as helpful

2

P
Andrija 510

@andrijaivkovic

Posted

@KorniDoS I sensed that it might have something to do with caching but didn't investigate it further. Thank you so much for the provided feedback!

0

@zubyCharles

Posted

I ran into the exact same problem when I did the challenge. Firefox kept returning the same advice object, worked well on chrome though. When I selected no-caching on my firefox browser settings it began working fine. So it’s a caching issue. I can see you’ve received help on how to solve this programmatically.

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