aboutsummaryrefslogtreecommitdiff
path: root/03_threads/script.mjs
blob: 4b52ae006b1d612fe0dc24c52689f75c136b49b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import Primes from "./build/primes.mjs";

var primes = await Primes();

var aInput = document.getElementById("aInput");
var bInput = document.getElementById("bInput");
var button = document.getElementById("goButton");
var resultText = document.getElementById("resultText");

button.addEventListener("click", () => {
	var a = Number(aInput.value);
	var b = Number(bInput.value);
	const count = primes._primes_in_range(a, b);
	resultText.innerText = "There are " + count + " primes between " +
	    a + " and " + b;
});

Generated with cgit - Back to sebastiano.tronto.net