Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
johnny lawma
3,298 PointsAlert dialog, why do we use alert dialog so often, when learning javascript?
i just learning javascript, i wonder why are we use alert or pop up? instead of doing in real web content, i don't think i will need a lot of pop up alert on my site.
2 Answers
John Lack-Wilson
8,181 PointsYou're right, it's not all that common to see js alerts on websites.
I would suspect the reason they get you to do this is because an alert is an instant method of feedback to show you that your logic was correct. Whereas if you were to create 'real web content', this may be a lengthier process, and might require some pre-requisite knowledge (HTML, CSS, etc). Once you've learned the syntax of JavaScript, you can easily apply it to HTML, CSS to achieve 'real web content'.
Antti Lylander
9,686 PointsJust because using prompt is the easiest way to get input into your program. Don't worry, keep going and soon you'll learn about more sophisticated input methods.