mirror of
https://gitlab.com/harald.mueller/aktuelle.kurse.git
synced 2024-11-24 02:31:58 +01:00
38 lines
1.1 KiB
HTML
38 lines
1.1 KiB
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() {
|
||
|
$('#array1').val("");
|
||
|
$('#array2').val("");
|
||
|
$('#array3').val("");
|
||
|
// alert("Test");
|
||
|
$.get("http://localhost/M133/jquery/jquery9.php", function(data){
|
||
|
var duce = jQuery.parseJSON(data);
|
||
|
var art1 = duce.key1;
|
||
|
var art2 = duce.key2;
|
||
|
var art3 = duce.key3;
|
||
|
$('#array1').val(art1);
|
||
|
$('#array2').val(art2);
|
||
|
$('#array3').val(art3);});
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
});
|
||
|
});
|
||
|
</script>
|
||
|
</head>
|
||
|
<body>
|
||
|
<h2>Get PHP Array Data</h2>
|
||
|
<p>Array Inhalt 1: <input type='text' size='40' id='array1' name='array1' /></p>
|
||
|
<p>Array Inhalt 2: <input type='text' size='40' id='array2' name='array2' /> </p>
|
||
|
<p>Array Inhalt 3: <input type='text' size='40' id='array3' name='array3' /> </p>
|
||
|
<input type='button' id='btn1' value='CALL PHP Function JASON value return Array' />
|
||
|
|
||
|
</body>
|
||
|
</html>
|