Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Basics (Retired) Introducing JavaScript Your First JavaScript Program

Preview opens up a new tab in Chrome, instead of the dialog box. Why?

I've cleared all cache and cookies, and even reset the Chrome settings. Is there another setting that I need to check?

So, it appears as though my dialog box just looks different than McFarland's in the video. But the next thing I'm not getting is that with the first exercise, the "alert" for Thanks for Visiting is popping up before document.write page displays. Sorry for being such a noob; but that's why I'm here.

3 Answers

Dalton Dunn
Dalton Dunn
6,709 Points

If I remember correctly I know some videos need be to brought up to date with new JS stuff, document.write will always go up after all alerts are done instead of with them now.

right on. Thanks again. At least I understand what I am seeing, and see the "logic".

Dalton Dunn
Dalton Dunn
6,709 Points

put your <src> tag at the very bottom of the page right above the </body> tag so that everything else in the code will run before the javascript

Thanks Dalton. In the first lesson, <src> tag is not even mentioned. But I am moving into the next lesson and I can see that it will be addressed shortly. Thank you for your quick response.

Dalton Dunn
Dalton Dunn
6,709 Points

No problem have fun learning JS! It's getting more and more powerful, good thing to learn

ok. So, I have an alert element on the JS page, that is being referenced by the <src> tag on the HTML page. The <src> tag is at the bottom, above the </body> tag. But, when I preview it, the alert dialog box comes up before the HTML document presents itself.