September 2018
Intermediate to advanced
328 pages
9h 10m
English
We're going to need an HTML page with a <canvas> element and JavaScript code to interact with the Wasm module. Create a file named without-glue.html in the /chapter-05-create-load-module folder and populate it with the following contents:
<!doctype html><html lang="en-us"><head> <title>No Glue Code</title> <script type="application/javascript" src="../common/load-wasm.js"></script></head><body> <h1>No Glue Code</h1> <canvas id="myCanvas" width="255" height="255"></canvas> <div style="margin-top: 16px;"> <button id="actionButton" style="width: 100px; height: 24px;"> Pause </button> </div> <script type="application/javascript"> const canvas = document.querySelector('#myCanvas'); const ctx = canvas.getContext('2d'); const env = ...Read now
Unlock full access