aboutsummaryrefslogtreecommitdiff
path: root/03_threads/script.mjs
diff options
context:
space:
mode:
Diffstat (limited to '03_threads/script.mjs')
-rw-r--r--03_threads/script.mjs16
1 files changed, 16 insertions, 0 deletions
diff --git a/03_threads/script.mjs b/03_threads/script.mjs
new file mode 100644
index 0000000..4b52ae0
--- /dev/null
+++ b/03_threads/script.mjs
@@ -0,0 +1,16 @@
1import Primes from "./build/primes.mjs";
2
3var primes = await Primes();
4
5var aInput = document.getElementById("aInput");
6var bInput = document.getElementById("bInput");
7var button = document.getElementById("goButton");
8var resultText = document.getElementById("resultText");
9
10button.addEventListener("click", () => {
11 var a = Number(aInput.value);
12 var b = Number(bInput.value);
13 const count = primes._primes_in_range(a, b);
14 resultText.innerText = "There are " + count + " primes between " +
15 a + " and " + b;
16});

Generated with cgit - Back to sebastiano.tronto.net