samples: add html file for module demo

This commit is contained in:
Alexey Andreev 2024-04-12 21:16:02 +02:00
parent 271545a3ef
commit abb1ea0070
2 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<title>Test module</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script type="module" charset="utf-8">
import { foo, bar } from "./js/module-test.js"
document.body.onload = () => {
let fooButton = document.getElementById("foo");
fooButton.onclick = () => {
foo();
}
let barButton = document.getElementById("bar");
let barArgInput = document.getElementById("bar-arg");
barButton.onclick = () => {
alert(bar(parseInt(barArgInput.value)));
}
};
</script>
</head>
<body>
<p><button id="foo">call foo (result in console)</button></p>
<p><button id="bar">call bar: </button> <input id="bar-arg" type="text" value="23"></p>
</body>
</html>

View File

@ -50,7 +50,7 @@ tasks.war {
} }
tasks.assemble { tasks.assemble {
dependsOn(tasks.generateWasi,) dependsOn(tasks.generateWasi)
} }
val buildNativeLinux by tasks.register<Exec>("buildNativeLinux") { val buildNativeLinux by tasks.register<Exec>("buildNativeLinux") {