-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
32 lines (28 loc) · 968 Bytes
/
Copy pathindex.html
File metadata and controls
32 lines (28 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>JS Examples</title>
<style>
body { font-family: system-ui,Segoe UI,Roboto,Arial; padding: 2rem; }
pre { background:#f4f4f4; padding:1rem; border-radius:6px }
</style>
</head>
<body>
<h1>JavaScript Examples</h1>
<p>This page demonstrates importing the ES module <code>modules/export.js</code> in the browser.</p>
<div id="output">
<p><em>Running module...</em></p>
</div>
<script type="module">
import greet, { PI, square } from './modules/export.js';
const out = document.getElementById('output');
const lines = [];
lines.push(`<strong>${greet('Dave')}</strong>`);
lines.push(`PI: ${PI}`);
lines.push(`square(5): ${square(5)}`);
out.innerHTML = '<pre>' + lines.join('\n') + '</pre>';
</script>
</body>
</html>