mirror of
https://gitlab.com/harald.mueller/aktuelle.kurse.git
synced 2024-11-27 20:21:56 +01:00
32 lines
978 B
HTML
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>
|