aktuelle.kurse/m133/Modul_Unterlagen_133_VOR/01-Modulinhalte/07 Script (JQuery)/07 jQuery Lösungen/jQuery6.html

31 lines
938 B
HTML
Raw Normal View History

2022-02-24 09:37:43 +01:00
<!DOCTYPE html>
<!https://www.w3schools.com/jquery/ajax_get.asp>
<html>
<head>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.4.js""></script>
<script type="text/javascript">
$(document).ready(function() {
$("#btn1").click(function () {
$('#iofield').val("");
$.get( "http://localhost/M133/jquery/jquery6.php", function(data, status, xhr) {
if (status == "success") {
// alert("Daten vorhanden");
returnvalue = data;
alert("Data loaded: " + status);
$('#iofield').val(data); }
else {alert("Keine Daten vorhanden")}
});
});
});
</script>
</head>
<body>
<h2>Show return value from PHP Call</h2>
<div id='input'>
<input type="text" size="40" id="iofield" name="iofield" />
<input type='button' id='btn1' value='CALL PHP Function return data with $.get()' />
</div>
</body>
</html>