aktuelle.kurse/m133/4_Modulinhalte_und_Uebungen/07-JQuery-skript/07-jQueryLoesungen/jQuery8.html
Harald G. Mueller cdff097ef7 muh
2022-03-17 11:19:26 +01: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>