diff options
| author | Brian Cully <bjc@spork.org> | 2025-08-07 12:05:51 -0400 |
|---|---|---|
| committer | Brian Cully <bjc@spork.org> | 2025-08-07 12:05:51 -0400 |
| commit | 58f6fbe0afb828571463a22737603a037b059909 (patch) | |
| tree | 5a2027883c4970f1876164b9e45d0691988ccf66 /main.mjs | |
| parent | b2e411de770a437dbdf31408b877e2952759e57a (diff) | |
| download | addem-rust-wasm-58f6fbe0afb828571463a22737603a037b059909.tar.gz addem-rust-wasm-58f6fbe0afb828571463a22737603a037b059909.zip | |
add imports from javascript
‘alert’ and ‘console.debug’
Diffstat (limited to 'main.mjs')
| -rw-r--r-- | main.mjs | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); |
