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
207,980 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>