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

Pod request access landing page using JavaScript DOM Manipulation

P

@grifano

Desktop design screenshot for the Pod request access landing page coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hi, and welcome to my solution 👋

I am still having difficulties with JS and it is difficult for me to decide what is the right solution to fix the problem. When I'm working on something and figuring out a problem, I see a different solution and try to implement it. But then I find another solution and so on ... How do you know when to stop and move forward?

About best practices... I like to define all necessary variables and functions on top of the file. But, I see a lot of functions that are defined at bottom of the file and will execute on top. So what is a good practice for that?

Community feedback

P
ApplePieGiraffe 30,545

@ApplePieGiraffe

Posted

Hey there, Serhii! 👋

Good job on this challenge! 👏

It looks like you've disabled scrolling on the page. That means means some of the content of the page might not be reachable if it is not visible and cannot be scrolled to. I'd recommend reviewing your code to fix this! 😉

As for finding ways to do things in code (and JS), there are often many ways to accomplish the same thing, and sometimes it's not always immediately clear what way you should use. As you learn how to code, I'd advise to not worry too much about finding the best possible solution to a problem and simply focus on finding a solution that works. As you move along, you'll gain experience and start to spot good/bad/better ways to do things.

You can define functions at the bottom of your file if they are function declarations, but there's not a huge advantage to doing this unless you want to order your code in a specific way. Sometimes, it just makes sense to write your functions and organize them at the beginning of your file, or place them together with other code that they are associated with. It's really up to you and/or those whom you are working with.

Hope you find this helpful. 😊

Keep coding (and happy coding, too)! 😁

Marked as helpful

2

P

@grifano

Posted

@ApplePieGiraffe Hi, sorry for the long reply 👋 Thank you for such nice feedback. I disable scrolling, because it no content at the rest of the page. According to the design its a single section. Yes, I definitely feal like as I'm do wory a much about this things, I will be trying to focus on the finding works solution 😉

Actually this JS function definition is confusing for me. I hope that will be more obvious with more practice. Than you 🙏

1
P
ApplePieGiraffe 30,545

@ApplePieGiraffe

Posted

@Grifano

No worries! Glad to help! 😊

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