mirror of
https://github.com/zekexiao/pocketlang.git
synced 2025-02-06 04:37:47 +08:00
35 lines
947 B
HTML
35 lines
947 B
HTML
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
<title>Document</title>
|
||
|
|
||
|
<script type = "text/javascript">
|
||
|
var runSource;
|
||
|
window.onload = function() { // called after index.html is loaded -> Module is defined.
|
||
|
runSource = Module.cwrap('runSource', 'number', ['string']);
|
||
|
document.getElementById("run").onclick = function() {
|
||
|
document.getElementById('out').innerText = '';
|
||
|
let source = document.getElementById('code').value;
|
||
|
runSource(source);
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
</head>
|
||
|
<body style="padding:0 0 0 100px">
|
||
|
|
||
|
<button id="run" style="width:100px; height:100px">Run</button>
|
||
|
<br> <br>
|
||
|
|
||
|
<textarea id="code" style="width:500px; height:300px"></textarea>
|
||
|
<br><br>
|
||
|
|
||
|
<p id="out"></p>
|
||
|
|
||
|
<script async type="text/javascript" src="try_online.js"></script>
|
||
|
|
||
|
</body>
|
||
|
</html>
|