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

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

alert("Hello From Treehouse"); When i preview this statement through workspaces a dialogue box does not appear..

in the preview like it is suppose to . The statement is written in scripts.js file on workspaces. Another tab opens but no dialogue appears. I am using Google Chrome Version 44.0.2403.130 (64-bit). I have checked the "enable javascript" setting and turned off the pop up blocker in my browser and still nothing. Help?

Can you share your code? The alert call nested in a function?

Dan Oswalt alert("Hello From Treehouse"); This is the only code in my file. It is not nested in a function. I am following along to the first video of javascript programming and it starts with this simple alert.

6 Answers

Your code is right, so the problem may be that scripts.js is not linked correctly in the html. It has to be exact:

<script src='scripts.js'></script>

Dan Oswalt you're the man! Silly forgetfulness on my part.

Jesse Powell
PLUS
Jesse Powell
Courses Plus Student 244 Points

seems to be a Chrome problem. I don't experience the issue in Safari.

Jeff Lemay
Jeff Lemay
14,268 Points

Do you have script tags wrapped around that?

<script>
alert("Hello From Treehouse");
</script>

Assuming you are working in an html file.

Jeff Lemay I tried wrapping alert("Hello From Treehouse"); in script tags still nothing. I am working in a scripts.js file.

Jeff Lemay
Jeff Lemay
14,268 Points

Sounds like the path to your js file is off. You could try adding what I posted above directly to your html instead of linking to an outside file and see if everything works. If it does, it's definitely an issue with your path.

Sloan Wolf
seal-mask
.a{fill-rule:evenodd;}techdegree
Sloan Wolf
iOS Development Techdegree Student 1,330 Points

experiencing the same issue. tried in both safari and chrome. opens new window, but no dialogue/alert... tried all suggestions above, still nothing. any suggestions?

Hi Sloan,

The problem is reproducible in Chrome, but doesn't happen in Firefox, at least for me. According to Jesse Powell, he doesn't see the problem in Safari, so it may be a version issue as well. I submitted some details from Chrome Dev Tools in screenshots to help them see what I see. It turns out, for some reason, that the saved "scripts.js" file is empty when referenced by the browser.

Like me, I'd bet that most of the trouble you have in this course will be silly typos and "darn, I forgot that semicolon or closing brace - \\insert facepalm here". However, every once in a while, it really is the underlying programming and programs. I think they are pretty Apple-heavy, but maybe they can find a way to check it out. Treehouse can't be responsible for a bug in Chrome, but I hope they will consider properly documenting and filing it, if it is truly a bug.

If you are local, drop by a meetup and talk to the instructors live! They're pretty neat in person too.

I'm experiencing the same issue. Tried it in chrome and firefox.