Pibd-22_Emelyanov_A.S._IP/frontend/script.js

17 lines
499 B
JavaScript
Raw Normal View History

2023-02-19 15:53:42 +04:00
'use strict'
2023-03-11 20:38:01 +04:00
async function calculate(){
let num1 = document.getElementById("input1").value
let num2 = document.getElementById("input2").value
let operator = document.getElementById("operator").value
let result = document.getElementById("result")
let type = document.getElementById("Type").value
2023-02-19 15:53:42 +04:00
2023-03-11 20:38:01 +04:00
let response = await fetch(`http://localhost:8080/${operator}?Type=${type}&value1=${num1}&value2=${num2}`)
let res = await response.text()
result.value = res
2023-02-19 15:53:42 +04:00
}
2023-03-11 20:38:01 +04:00