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 trialRaphael Reiter
6,820 PointsCode 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
Michal Weizman
14,050 PointsHi 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.
David Rhodes
Courses Plus Student 2,352 PointsBeen thwarted by this too. Not encouraging as it's the first lesson and no response from TreeHouse for over two weeks...
Jacob Neulight
1,099 PointsIt 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.
Nick Weight
1,890 PointsRefreshing the page is only way I got the preview to work as well.
Aniko Hegedus
6,082 PointsThe workspace doesn't work for me either. :( It just opens a blank page no matter what I try.
Aniko Hegedus
6,082 PointsIt does work in Chrome but not in Mozilla.
Michael Kalmykov
8,919 Pointsalert("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
Clovis Shropshire
7,139 PointsCode is right, the workspace just doesn't work :(
Alexander Simola
Courses Plus Student 560 PointsFor me the problem was simply that I did not add the second and closing quotation mark in the alert() statement.