Skip to content

Commit 1bc7734

Browse files
Provide HTML content for index.html file (documentationjs#360)
1 parent 2859217 commit 1bc7734

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

guides/Getting-Started.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,26 @@ Spago can be used to turn our PureScript code into JavaScript suitable for use i
260260
Build succeeded.
261261
Bundle succeeded and output file to index.js
262262

263-
All the code in the `src` directory and any project dependencies have been compiled to JavaScript. The resulting code is bundled as `index.js` and has also had any unused code removed, a process known as dead code elimination. This `index.js` file can now be included in an HTML document. If you try this, you should see the words "Hello, World!" printed to your browser's console.
263+
All the code in the `src` directory and any project dependencies have been compiled to JavaScript. The resulting code is bundled as `index.js` and has also had any unused code removed, a process known as dead code elimination. This `index.js` file can now be included in an HTML document.
264+
265+
Try creating an `index.html` file with the following contents:
266+
267+
```html
268+
<!DOCTYPE html>
269+
<html>
270+
271+
<head>
272+
<meta charset="UTF-8">
273+
<title>Euler Exercise</title>
274+
</head>
275+
276+
<body>
277+
<script src="./index.js"></script>
278+
<body>
279+
280+
</html>
281+
```
282+
Open this `index.html` file in your web browser. The page will be blank, but if you open the browser's developer console, you should see a log message containing: "The answer is 233168".
264283

265284
If you open `index.js`, you should see a few compiled modules which look like this:
266285

0 commit comments

Comments
 (0)