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 JavaScript Basics (Retired) Introducing JavaScript Your First JavaScript Program

Code doesnt work

I am writing the same line of code.

I have deleted all my history, I have tried on different browsers for the last 45 minutes. This is so annoying!! it is not working at all !!!

alert("Hello from treehouse"); document.write(<h1>Welcome to Javascript basics</h1>);

these two lines do nothing...

8 Answers

Hi Raphael, I don't see anything wrong with the first line of code. However, the second is missing Quotation Marks like so:

alert("Hello from treehouse");
document.write("Welcome to Javascript basics");

I hope this helped.

Been thwarted by this too. Not encouraging as it's the first lesson and no response from TreeHouse for over two weeks...

It works for me only after refreshing the page. Simply clicking the preview button isn't enough. Your also might need to tell your adblocking to add an exception for Treehouse's site.

Refreshing the page is only way I got the preview to work as well.

The workspace doesn't work for me either. :( It just opens a blank page no matter what I try.

It does work in Chrome but not in Mozilla.

alert("Hello from treehouse"); document.write("Welcome to Javascript basics");

Doesn't work for me either out of workspace, but same code works fine out of my own local set up. I think there is a bug with workspace where JS isn't initializing, console shows no errors when i inspect from chrome

Code is right, the workspace just doesn't work :(

For me the problem was simply that I did not add the second and closing quotation mark in the alert() statement.