github.com/mattn/anko@v0.1.10/misc/wasm/index.html (about)

     1  <html>
     2    <head>
     3      <title>Anko WebAssembly</title>
     4      <script src="wasm_exec.js"></script>
     5      <script type="text/javascript">
     6      function fetchAndInstantiate(url, importObject) {
     7        return fetch(url).then(response =>
     8          response.arrayBuffer()
     9        ).then(bytes =>
    10          WebAssembly.instantiate(bytes, importObject)
    11        ).then(results =>
    12            results.instance
    13        );
    14      }
    15      var go = new Go();
    16      var mod = fetchAndInstantiate("/anko.wasm", go.importObject);
    17      window.onload = function() {
    18        mod.then(function(instance) {
    19          go.run(instance);
    20        });
    21      };
    22      </script>
    23      <style>
    24      #result { width: 100%; height: 300px; overflow-y: scroll; }
    25      #input { width: 100%; }
    26      .stdout { margin: 0px; }
    27      .command { margin: 0px; color: gray; }
    28      .stderr { margin: 0px; color: red; }
    29      </style>
    30    </head>
    31    <body>
    32      <div id="result">loading...</div>
    33      <input id="input" type="text" value="" disabled=true /><br />
    34    </body>
    35  </html>