aktuelle.kurse/old_m133/4_Modulinhalte_und_Uebungen/07-JQuery-skript/07-jQueryLoesungen/jQuery9.html

38 lines
1.1 KiB
HTML
Raw Normal View History

2022-02-24 09:37:43 +01:00
<!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>