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 trialGiorgi Kiknadze
Courses Plus Student 2,768 PointsAdd your code and I can help you.
Robert Bishop
959 PointsI had the same problem. You have to click File --> Save first. Then preview.
Christopher Denny
10,460 PointsOne thing I suggest is selecting the "index.html" page and previewing that since javascript has no default display properties and leaves that up to the html.
If you are already doing this, I would suggest double-checking and ensuring that the javascript file is linking properly in your HTML file i.e. <script src = "script.js"> and placing this at the end of your html file inside of the <body> tag.
If you're still having issues, it's likely the Javascript not running because there is an error somewhere in your code, in which to properly deduce what the issue is, we will need to see your code.
Wish you the best, Yi! -Christopher Denny
4 Answers
Jonathan Wright
5,853 PointsMake sure you are not running any sort of adblockers on your team treehouse pages. I have found that this will cause issues with some of my code.
Denise Edwards
4,924 PointsThis was my problem exactly!
I use Adblocker on Google Chrome. When I excluded blocking from all pages in the teamtreehouse.com/* domain, and refreshed the preview page it started working :)
George Nono
11,256 PointsHi
I have figured this out, I had the same problem. I'm not sure if you fixed it or not but this is what I did.
I created a new workspace - I made a file and titled it "index.html" - I added the following: <!DOCTYPE html> <html> <head></head> <body> <script src='scripts.js'></script> </body> </html>
I then created another file and titled it "scripts.js" - I typed in the alert and the document.write and it worked.
If you have any questions please contact me.
Sandeep Kankatala (ESU Admin)
1,713 PointsI faced the same problem.
Step 1: I renamed the scripts.js file to myscripts.js
Step 2: Change the file name in the src attribute in index.html. Save changes.
Step 3: Click on Preview button. If the browser opens up a blank page, then add /index.html.
It should like http://port-80-xxxxxxx.treehouse-app.com/index.html and then hit enter.
Emmanuel Okonkwo
Courses Plus Student 39 PointsDidn't want to clear my cache so did this and it worked perfectly. Thanks
Jared Lenover
2,120 PointsMy alert command didn't seem to work properly when I was in Firefox. (Might just be my settings.)
I logged into Treehouse in Chrome and tried again. Worked. :)
Julian Gutierrez
19,201 PointsJulian Gutierrez
19,201 PointsCan you please post your code so we can better assist you?