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

James Joyce
James Joyce
3,551 Points

JavaScript 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.

Kristopher Van Sant
Kristopher Van Sant
Courses Plus Student 18,830 Points

Hey 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!

James Joyce
James Joyce
3,551 Points

Try clearing your browser history, it was a cache problem for me.

2 Answers

Hi 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
James Joyce
3,551 Points

Thank you! I just had to clear my browser data

I 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
Raphael Reiter
6,820 Points

I cleared all my history, and still nothing....