Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,829 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

bothxp
bothxp
16,509 Points

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