summaryrefslogtreecommitdiffstats
path: root/main.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'main.mjs')
-rw-r--r--main.mjs6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.mjs b/main.mjs
index 086b876..d8fe63a 100644
--- a/main.mjs
+++ b/main.mjs
@@ -4,6 +4,7 @@ async function run() {
console.debug('run');
const foo = await init();
console.debug('init done', foo);
+
window.calculate = _ => {
console.debug('calc');
const inp1 = document.getElementById('number-input1').value;
@@ -11,6 +12,11 @@ async function run() {
const res = foo.add(parseInt(inp1), parseInt(inp2));
document.getElementById('result').textContent = res;
}
+
+ window.testalert = _ => {
+ console.debug('testalert');
+ foo.test_alert('from js');
+ }
}
document.addEventListener('DOMContentLoaded', run);