This repository has been archived by the owner on May 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
45 lines (33 loc) · 1.57 KB
/
index.html
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
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Note the HTML5 doctype! This is NOT optional for IE -->
<meta charset="utf-8">
<title>Elm 0.18 Legacy Browser Setup</title>
</head>
<body>
<!-- Note that older browsers may need the `type` attribute -->
<!-- This is using simple script tags, you're free to use your bundling tool of choice, of course -->
<!-- NPM polyfills -->
<script type="text/javascript" src="./node_modules/console-polyfill/index.js"></script>
<script type="text/javascript" src="./polyfills/xml-http-request.js"></script>
<!-- Nobody supplies these kind of polyfills via a package manager so this is old-school copy&paste from MDN and others, licenses are included in source or are linked from there -->
<script type="text/javascript" src="./polyfills/array-index-of.js"></script>
<script type="text/javascript" src="./polyfills/string-trim.js"></script>
<script type="text/javascript" src="./polyfills/add-event-listener.js"></script>
<!-- The original JSON by Douglas Crockford -->
<script type="text/javascript" src="./polyfills/json2.js"></script>
<!-- Include your Elm app *after* the polyfills -->
<script type="text/javascript" src="./dist/app.js"></script>
<script type="text/javascript">
// Tadaaa!
var app = Elm.Main.fullscreen({
initialCounter: 42
});
app.ports.fromElm.subscribe(function (msg) {
console.log("app.ports.fromElm: ", msg);
});
app.ports.toElm.send("Hello from ancient times!");
</script>
</body>
</html>