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

No alert() working

So I'm trying the follow along with the video of making the first alert using workspace for the first time in js but when i run the preview with just a simple alert() function call nothing seems to happen. the web page opens there is a small white bar in the page ( I think this is supposed to be a full page) but nothing

Can we see your code?

5 Answers

Ara- this is just a shot in the dark but if you are working on JavaScript basics the alert looks like this:

alert("hello there");

Ya i have that the product prob i think its with the preview workspace or the html. But all ive tried to do waz alert("sup") ;

I am having the same issue.

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?

I'm sure you are doing this but I will ask anyway. Are you saving your file before trying to preview?

Ara Ekmekjian I was able to solve the issue I was having which is the same issue you are having. Make sure that your index.html contains:

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

This will link your scripts.js file to your html and thus your javascript will show when you preview it in workspaces.

Let me know if this helps!

I am having the same problem and the fix above did not solve it.

alert("hello there"); is not generating the alert. I have <script src='scripts.js'></script> in my html.

Hi Cora can you share the HTML? make sure to take a look at the "markdown cheat sheet" so that it displays properly. Sharing code is critical to getting good feedback.