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!

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

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