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
Ara Ekmekjian
1,397 PointsNo 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
5 Answers
Kathleen Sapp
12,776 PointsAra- this is just a shot in the dark but if you are working on JavaScript basics the alert looks like this:
alert("hello there");
Ara Ekmekjian
1,397 PointsYa 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") ;
Amandeep Dindral
8,915 PointsI 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?
Kathleen Sapp
12,776 PointsI'm sure you are doing this but I will ask anyway. Are you saving your file before trying to preview?
Amandeep Dindral
8,915 PointsAra 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!
Cora Weiss
Courses Plus Student 1,271 PointsI 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.
Dan Oswalt
23,438 PointsHi 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.
Dan Oswalt
23,438 PointsDan Oswalt
23,438 PointsCan we see your code?