44 lines
1.3 KiB
JavaScript
44 lines
1.3 KiB
JavaScript
|
'use strict'
|
||
|
let num1 = document.getElementById("input1")
|
||
|
let num2 = document.getElementById("input2")
|
||
|
let num3 = document.getElementById("input3")
|
||
|
let num4 = document.getElementById("input4")
|
||
|
let num5 = document.getElementById("input5")
|
||
|
let num6 = document.getElementById("input6")
|
||
|
let num7 = document.getElementById("input7")
|
||
|
let num8 = document.getElementById("input8")
|
||
|
|
||
|
let operator = document.getElementById("operator")
|
||
|
let result = document.getElementById("result")
|
||
|
|
||
|
async function Sum(){
|
||
|
let str1 = num1.value
|
||
|
let str2 = num2.value
|
||
|
let response = await fetch(`http://localhost:8080/Sum/${str1}/${str2}`)
|
||
|
let res = await response.text()
|
||
|
result.value = res
|
||
|
}
|
||
|
|
||
|
async function ToUpper(){
|
||
|
let str3 = num3.value
|
||
|
let response = await fetch(`http://localhost:8080/ToUpper/${str3}`)
|
||
|
let res = await response.text()
|
||
|
result.value = res
|
||
|
}
|
||
|
|
||
|
async function Split(){
|
||
|
let str4 = num4.value
|
||
|
let str5 = num5.value
|
||
|
let response = await fetch(`http://localhost:8080/Split/${str4}/${str5}`)
|
||
|
let res = await response.text()
|
||
|
result.value = res
|
||
|
}
|
||
|
|
||
|
async function Replace(){
|
||
|
let str6 = num6.value
|
||
|
let str7 = num7.value
|
||
|
let str8 = num8.value
|
||
|
let response = await fetch(`http://localhost:8080/Replace/${str6}/${str7}/${str8}`)
|
||
|
let res = await response.text()
|
||
|
result.value = res
|
||
|
}
|