tinygo/src/examples/wasm/wasm.html
Ayke van Laethem dbb3211485
wasm: add glue JS code
The file wasm_glue.js was copied from the Go wasm port and was modified,
most importantly to match the TinyGo calling convention.
2018-11-24 19:03:58 +01:00

16 строки
496 Б
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Go WebAssembly</title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<script src="../../../targets/wasm_exec.js" defer></script>
<script src="wasm.js" defer></script>
</head>
<body>
<h1>WebAssembly</h1>
<p>Add two numbers, using WebAssembly:</p>
<input type="number" id="a" value="2"/> + <input type="number" id="b" value="2"/> = <input type="number" id="result" readonly/>
</body>
</html>