aktuelle.kurse/oldies/m133/Modul_Unterlagen_133_VOR/01-Modulinhalte/07 Script (JQuery)/07 jQuery Lösungen/jQuery8.html
Müller Harald 3fdacd20c0 muh
2022-07-28 09:14:44 +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>