1
0
This repository has been archived on 2024-10-30. You can view files and clone it, but cannot push or open issues or pull requests.
SDi-HTML-Exercise/script.js

18 lines
571 B
JavaScript
Raw Normal View History

$(document).ready(function() {
$('form').on('submit', function(event) {
event.preventDefault();
var operandA = $('input[name="operandA"]').val();
var operandB = $('input[name="operandB"]').val();
$.ajax({
type: 'POST',
url: 'http://webex.sdi.hevs.ch/calc',
data: { operandA: operandA, operandB: operandB },
success: function(data) {
var result = $(data).find('strong').text();
$('input[name="result"]').val(result);
}
});
});
});