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 trialmelissa brown
4,670 Pointschange to alert box message doesnt pop up?
when i change the message to an alert box instead of document.write the message does not pop up. why is this?
var visitor = prompt("what is your name?");
var message = 'hello ' + visitor;
alert(message);
2 Answers
Ryan Field
Courses Plus Student 21,242 PointsWhen I copied and pasted your code in the console, it worked just fine. Is this all your code, or is there perhaps something else before or after that's interfering?
Marcus Parsons
15,719 PointsI've had trouble out of Google Chrome with displaying alert, prompt, and other JS activated boxes. Those boxes have been showing up behind the window and have to be blindly interacted with.
Acie Slade
Front End Web Development Techdegree Student 10,895 PointsIn case this is causing other folks problems in Chrome, you may need to ensure that you don't have other browser tabs open (as a result of you clicking the "preview workspace" icon from previous JS Basics exercises).
Once I closed all of them, I clicked on "preview workspace" (as if going through the exercise for first time) and the alert box showed up as expected.
Marcus Parsons
15,719 PointsMarcus Parsons
15,719 PointsMelissa, are you using Google Chrome perchance?