浏览代码

Set page to be ready immediately

Set a small sample program as the code box's initial value. Set the run
button to run CodeBox.protoype.ParseCodeBox, which will run the supplied
code.
ApisNecros 1 年之前
父节点
当前提交
5a472a9db2
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      index.html

+ 3 - 3
index.html

@@ -11,10 +11,10 @@
                 <input type="text" id="stackInit" class="inline-block w-full p-2 border border-black rounded-sm" placeholder="Initial Stack" />
             </div>
             <div>
-                <textarea id="script" class="w-full border border-black" rows="20" placeholder="11+n;"></textarea>
+                <textarea id="script" class="w-full border border-black" rows="20" placeholder="11+n;">11+n;</textarea>
             </div>
             <div class="flex justify-center items-center">
-                <button class="p-4 border border-black bg-blue-300 rounded" onclick="engine.Run()">Run</button>
+                <button class="p-4 border border-black bg-blue-300 rounded" onclick="cb.ParseCodeBox()">Run</button>
             </div>
             <div>
                 <textarea id="output" class="w-full border border-black" rows="20"></textarea>
@@ -22,7 +22,7 @@
         </div>
         <!-- <canvas class="w-full h-full"></canvas> -->
         <script>
-            const cb = new CodeBox("script", "output", "stackInit");
+            const cb = new CodeBox("script", "stackInit", "output");
         </script>
     </body>
 </html>