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

Javascript Code in Workspace not appearing in html doc

I am following along with this video typing the same code in Workspace and I am not returning the same output when I click on the "preview workspace" icon. I am saving the document to Workspace prior to clicking the icon. It is very basic code that I typed letter for letter.

The code generates a blank html page with a white rectangular box at the top that may be for a header element, on the standard html white background. In the video, the alert script generated a message prompt, where I did not see any message prompt when I executed my code.

alert("Hello from Treehouse"); document.write("<h1>Wecome to Javascript Basics</h1>");

1 Answer

Hello there!

Codepen will show the alert message promt only once after the first time you saved your pen. You have to refresh your page to display the prompt again. I hope this helps, check this screenshot: http://cl.ly/h2du