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

1,545 Points

workspace preview

Hello there, I downloads workspaces for learning Java script. But when i clicked the preview, it only prints out a mistake page like :

Index of / scripts.js

Is it the browser or should I choose certain environment for Javascript when I open Workspace?

Thank you for letting me know. LU

2 Answers

Steven Parker
Steven Parker
216,878 Points

You can't use the preview directly on a JavaScript file.

You should also have an *index.html" file in your workspace that loads it. A workspace launched from inside one of the JavaScript courses would provide one for you, but a blank workspace would not have one.

Here's a minimal index.html that should get you going:

<!doctype html>
        <meta charset="utf-8">
        <title>JavaScript Workspace</title>
        <h1>JavaScript Workspace</h1>
        <script src="scripts.js"></script>