aktuelle.kurse/old_m133/4_Modulinhalte_und_Uebungen/07-JQuery-skript/07-jQueryLoesungen/jQuery8.html
Müller Harald 507e5da390 muh
2022-05-13 11:53:50 +02:00

32 lines
978 B
HTML

<!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("");
// alert("Test1");
$.getJSON("http://localhost/M133/jquery/jquery8.php", function(data) {
// alert("Test2" +data[0]);
$('#nachname').val(data['Nachname']);
$('#vorname').val(data['Vorname']);
});
});
});
</script>
</head>
<body>
<h2>Show return value from PHP JSON Call</h2>
<div id='input'>
<p>Nachname: <input type='text' size='40' id='nachname' name='nachname' /></p>
<p>Vorname: <input type='text' size='40' id='vorname' name='vorname' /> </p>
<input type='button' id='btn1' value='CALL PHP Function JASON value return Array' />
</div>
</body>
</html>