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

Responsive advice generator

#accessibility#fetch#semantic-ui#node
Rachel 80

@rachelpr

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


Wondering if there are any tips for optimizing loading the advice slip on the page? Or anything that would make this smoother? Thanks!

Community feedback

@catherineisonline

Posted

Cool solution!

To improve semantics, make sure to wrap the entire code in the main tag not including header or footer tags. It will help to remove report issues and improve accessibility as well.

IF THIS WAS HELPFUL PLEASE MARK IT AS HELPFUL 🤩

Marked as helpful

1

Rachel 80

@rachelpr

Posted

@catherineisonline Thanks for the suggestion, I'll do some refactoring to improve semantics!

0

@Mattvp21

Posted

Hi Rachel,

I have a few tips.

-You may want to write the getAdvice function as an async/await function -Instead of doing window.reload on the dice button, I suggest adding an event listener to look for a click that will listen for your generateAdvice function -I suggest using textContent instead of innerHTML. innerHTML can open a website to cross-site-scripting attacks and shouldn't be used.

  • It's good practice to put things like document.querySelector.ononon into a global variable. I would do something like const adviceCard = document.querySelector('.advice-card). It's easier to manage when projects become large.

I hope this is helpful and happy coding! :)

-Matt

Marked as helpful

1

Rachel 80

@rachelpr

Posted

@Mattvp21 Thanks for the advice (heh), I'll do some refactoring, don't want to leave this vulnerable to XSS attacks!

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