Created
August 3, 2020 08:48
-
-
Save BMU-Verlag/4044461d26df6d70591cab6b4e0ca643 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>AJAX-Beispiel 2</title> | |
<script> | |
function laden(eingabe) { | |
let ajaxObj = new XMLHttpRequest(); | |
ajaxObj.onreadystatechange = ausgeben; | |
ajaxObj.open("GET", "speichern.php?inhalt=" + eingabe, true); | |
ajaxObj.send(); | |
} | |
function ausgeben(){ | |
if (this.readyState == 4 && this.status == 200) { | |
document.getElementById("eingabe").value = this.responseText; | |
} | |
} | |
</script> | |
<body> | |
<h1>Text an Server senden</h1> | |
Eingabe: <input id = "eingabe"><br><br> | |
<button type="button" onclick="laden(document.getElementById('eingabe').value)">Inhalt speichern</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment