-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFront.html
More file actions
37 lines (35 loc) · 1.03 KB
/
Front.html
File metadata and controls
37 lines (35 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html>
<head>
<title>Calculadora de Lógica Difusa</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<h1>Calculadora de Lógica Difusa</h1>
<label for="inputA">Valor A:</label>
<input type="number" id="inputA" step="0.01">
<br>
<label for="inputB">Valor B:</label>
<input type="number" id="inputB" step="0.01">
<br>
<button onclick="calculate()">Calcular</button>
<br>
<h3>Resultado:</h3>
<div id="result"></div>
<script>
function calculate() {
const inputA = parseFloat(document.getElementById('inputA').value);
const inputB = parseFloat(document.getElementById('inputB').value);
// Realiza una petición POST al backend con los valores de entrada
$.ajax({
url: '/fuzzy',
type: 'POST',
data: { inputA, inputB },
success: function(response) {
document.getElementById('result').textContent = response.result;
}
});
}
</script>
</body>
</html>