Submitted over 1 year ago
advice generator app using html, css and js with the adviceslip API.
@yassine-ramla
Design comparison
SolutionDesign
Solution retrospective
this challenge was new for me, this was the first time i deal with API's, i've also learnt something which is browsers doesn't treat api requests the same, for exmple in this challenge, chrome generate a new advice everytime the dice is clicked while firefox generate a new advice just once unless you are in the private mode. to solve this problem i've added a cache-busting parameter to the API request URL:
<section> <q id="advice"></q> </section>
const timestamp = new Date().getTime(); request.open("GET", `https://api.adviceslip.com/advice?time=${timestamp}`);
Community feedback
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