mirror of
				https://github.com/taigrr/wasm-experiments
				synced 2025-01-18 04:03:21 -08:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			500 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			500 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <!doctype html>
 | |
| <html>
 | |
| 
 | |
| <head>
 | |
|   <meta charset="utf-8">
 | |
|   <title>Go wasm</title>
 | |
| </head>
 | |
| 
 | |
| <body>
 | |
|   <script src="wasm_exec.js"></script>
 | |
|   <script>
 | |
|     async function loadAndCompile() {
 | |
|       let resp = await fetch("test.wasm");
 | |
|       let bytes = await resp.arrayBuffer();
 | |
|       await compile(bytes);
 | |
|       document.getElementById("runButton").disabled = false;
 | |
|     }
 | |
|     loadAndCompile();
 | |
|   </script>
 | |
| 
 | |
|   <button onClick="console.clear(); run();" id="runButton" disabled>Run</button>
 | |
| </body>
 | |
| 
 | |
| </html>
 |