mirror of
https://gitlab.com/harald.mueller/aktuelle.kurse.git
synced 2024-11-24 10:41:56 +01:00
32 lines
1.1 KiB
HTML
32 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() {
|
||
|
// $('#zahl1').val("");
|
||
|
// $('#zahl2').val("");
|
||
|
// $('#result').val("");
|
||
|
var zahl1=$('input:text[name=zahl1]').val();
|
||
|
var zahl2=$('input:text[name=zahl2]').val();
|
||
|
// alert("Test");
|
||
|
$.get("http://localhost/M133/jquery/jquery10.php", {zahl1: zahl1, zahl2: zahl2}, function(data){
|
||
|
var result = jQuery.parseJSON(data);
|
||
|
$('#result').val(result);});
|
||
|
|
||
|
});
|
||
|
});
|
||
|
</script>
|
||
|
</head>
|
||
|
<body>
|
||
|
<h2>Addition from BL</h2>
|
||
|
<p>Zahl1: <input type='text' size='40' id='zahl1' name='zahl1' /></p>
|
||
|
<p>Zahl2: <input type='text' size='40' id='zahl2' name='zahl2' /> </p>
|
||
|
<p>Resultat: <input type='text' size='40' id='result' name='result' readonly/> </p>
|
||
|
<input type='button' id='btn1' value='Rechne ADDITION' />
|
||
|
|
||
|
</body>
|
||
|
</html>
|