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

Aaron Davis
Aaron Davis
1,053 Points

When trying to preview workspace, it doesn't load the scripts.js file, so nothing is running.

I am trying to follow along with the video, but when clicking preview, nothing is happening because scripts.js isn't being loaded.

Jennifer Nordell
Jennifer Nordell
Treehouse Teacher

It'd be helpful if we could see your workspace. In the top right of the workspace is a camera icon. Take a snapshot of your workspace and then link us the URL so we can take a peek around. At this point, we can't know if it's the code or a problem with the browser.

1 Answer

Jennifer Nordell
STAFF
Jennifer Nordell
Treehouse Teacher

Your workspace previews fine for me but there is an error in your scripts.js. You have written this:

Document.write("<h1>Welcome to Javascript Basics</h1>");

It should be:

document.write("<h1>Welcome to Javascript Basics</h1>");

Note the capitalization of the word "document". Yes, it matters. When the capitalization is changed and the page is refreshed the "Welcome to Javascript Basics" displays on the page. I get the alert popping up for me. If you don't see the alert, make sure you're allowing popups in your browser and try clearing your browser cache.

Aaron Davis
Aaron Davis
1,053 Points

Ok, that part makes sense, initially I was having a problem with it even showing the alert. Once I created that link, I tried opening it and it ran without changing anything and it popped up just fine. So not sure what was going on, but it seems to be working now. I appreciate your help.