Update
This commit is contained in:
33
cgi-bin/vorbereitung/apiajax.html
Normal file
33
cgi-bin/vorbereitung/apiajax.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<!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>
|
Reference in New Issue
Block a user