Files
intecsync/cgi-bin/vorbereitung/apiajax.html
2019-07-29 11:21:30 +02:00

34 lines
1.1 KiB
HTML

<!DOCTYPE html>
<head>
<title>Lenschomode</title>
</head>
<body>
<form>
<label for="laufzeit">Dauer einer Schnensch Aktion</label>
<input id="laufzeit" type="number"></input>
<button id="calc" onclick="calc" type="button" value="Calculate!"></button>
</form>
<h1 id="lensch"></h1>
<script>
let calcbtn = document.getElementById("calc");
let lensch = document.getElementById("lensch");
let laufzeit = document.getElementById("laufzeit");
function calc() {
let req = new XMLHttpRequest();
req.onreadystatechange = function () {
if (this.readyState === 4 && this.status === 200) {
lensch.value = this.responseText;
}
}
req.open("GET", "api.php?n=" + laufzeit.value);
req.send();
}
</script>
</body>
</html>