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 trialJames Joyce
3,551 PointsJavaScript Basics workspace blank
When I attempt to preview the workspace for JavaScript Basics I just get a blank grey screen with a white box and no alert messages, and the document does not write to the screen view. I tried to launch the workspace preview on google chrome, firefox, and safari (I also made sure JavaScript was enabled on those browsers, and pop-up blocking was turned off). Please advise. Thank You.
James Joyce
3,551 PointsTry clearing your browser history, it was a cache problem for me.
2 Answers
bothxp
16,510 PointsHi James,
Can you just confirm for us that you added the example code to the scripts.js file and that it was saved after you had updated it?
When you first open that workspace the index.html is complete but the scripts.js file is empty. So if you hit preview then you will get the webpage as you described, without any of the JavaScript.
Also if you previewed the workspace before you had added the JavaScript to the scripts.js file then I suspect that it may be possible that your browser was just caching the pre-JavaScript version. *Actually I just tested this out (previewing the blank workspace first) and on my first couple of attempts my alert didn't appear, so I hit refresh a few times and then it started working. So I think you may be seeing a browser caching issue. * If you see the issue again try refreshing the page a few times or even closing down your browser tabs and browser.
James Joyce
3,551 PointsThank you! I just had to clear my browser data
cb123
Courses Plus Student 9,858 PointsI had exactly the same issue. I was not having the issue if i tried it in Brackets, however, I wanted to make sure my workspaces was working right.
After Clearing Cache and Reboot, my preview attempts directed from workspace are the expected result.
Raphael Reiter
6,820 PointsI cleared all my history, and still nothing....
Kristopher Van Sant
Courses Plus Student 18,830 PointsKristopher Van Sant
Courses Plus Student 18,830 PointsHey James, are you still having this issue? When I view the workspace preview I do get the same grey background and white box, since I believe that's how it's styled, but the alert does pop up for me. Did you change any code after you launched the workspace? If so, can you please share it? Thanks!