JavaScript JavaScript Basics (Retired) Introducing JavaScript Your First JavaScript Program

JIAYING LU
JIAYING LU
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:

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