Skip to content

Instantly share code, notes, and snippets.

@kdkanishka
Created January 24, 2020 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdkanishka/cb9b46e69b8b10bc838662fc1f0312fa to your computer and use it in GitHub Desktop.
Save kdkanishka/cb9b46e69b8b10bc838662fc1f0312fa to your computer and use it in GitHub Desktop.
<html>
<script src="hello.js"></script>
<script>
var fibProxy = Module.cwrap("fib", "number", ["number"]);
function calcFib(){
var input = document.getElementById("fibInput").value;
var result = fibProxy(input);
alert(result);
}
</script>
<body>
<label>Fib Calculator</label>
<input id="fibInput" type="text">
<button onclick="calcFib()">Calculate Fib!</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment