14 lines
434 B
JavaScript
14 lines
434 B
JavaScript
|
|
||
|
async function getData() {
|
||
|
const chance = document.getElementById("Chance").value
|
||
|
const mult = document.getElementById("Multiplicator").value
|
||
|
const url = "/random?chance="+chance+"&multiplicator="+mult;
|
||
|
try {
|
||
|
const response = await fetch(url);
|
||
|
const content = await response.text()
|
||
|
|
||
|
document.getElementById("won").innerText=content
|
||
|
} catch (error) {
|
||
|
console.error(error.message);
|
||
|
}
|
||
|
}
|