Design comparison
Solution retrospective
Is there something to improve? specially with javascript.
Community feedback
- @elaineleungPosted over 2 years ago
Hi Axel, well done putting this together! I think the JS looks good on the whole; you have error handling included, and everything looks readable to me (even though I don't understand Spanish). The only main issue is, that I can't load the next advice due to caching in Firefox; to fix this and allow Firefox users to also enjoy your app, just add a header object in fetch, like this:
fetch("https://api.adviceslip.com/advice", { cache: 'no-cache' })
Also, instead of
innerHTML
, you can trytextContent
since you're not overwriting the content with new HTML. Lastly, right now the sides of your app are touching the sides of the browser when I shrink down the browser, so I suggest adding a TW padding class to yourmain
element to give it some space.Great job, and hope this helps!
0
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