mirror of
https://github.com/geektutu/7days-golang.git
synced 2024-04-21 12:32:11 +00:00
18 lines
442 B
HTML
18 lines
442 B
HTML
<html>
|
|
|
|
<head>
|
|
<script src="static/wasm_exec.js"></script>
|
|
<script>
|
|
const go = new Go();
|
|
WebAssembly.instantiateStreaming(fetch("static/main.wasm"), go.importObject)
|
|
.then((result) => go.run(result.instance));
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<input id="num" type="number" />
|
|
<button id="btn" onclick="fibFunc(num.value * 1, (v)=> ans.innerHTML=v)">Click</button>
|
|
<p id="ans"></p>
|
|
</body>
|
|
|
|
</html> |