git @ Cat's Eye Technologies Dipple / master scheme / biwascheme.html
master

Tree @master (Download .tar.gz)

biwascheme.html @masterraw · history · blame

<!DOCTYPE html> 
<!--
SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
For more information, please refer to <https://unlicense.org/>
SPDX-License-Identifier: Unlicense
-->
<head>
  <meta charset="utf-8"/>
  <title>BiwaScheme test</title>
  <script src="http://catseye.tc/contrib/biwascheme/biwascheme-0.6.9-min.js" type="text/javascript"></script>
</head>

<body>
  <!-- Basic example of using BiwaScheme ( https://www.biwascheme.org/doc/reference.html#js-interface ). -->

  <h1>Hello, world!</h1>

  <button onclick="runScheme();">Run</button>

  <div style="border: 1px solid black" id="output">
  </div>
</body>

<script type="text/javascript">
function runScheme() {
    var i = new BiwaScheme.Interpreter();

    window.blah = 77;

    i.evaluate("(+ (js-eval \"window.blah\") 2)", function(e) {
        document.getElementById('output').innerHTML = ("" + e);
    });
}
</script>