DevOpsGOServer
37 строк · 829.0 Байт
1function getUppercase() {2let val = document.getElementById("get_key").value;3let body = {4s: val5}6
7console.log(JSON.stringify(body))8
9fetch("./uppercase", {10method: 'post',11body: JSON.stringify(body)12})13.then((response) => response.json())14.then((data) => {15console.log(data)16document.getElementById("get_answer").innerHTML = data.v;17});18}
19
20function getCount() {21let val = document.getElementById("get_key").value;22let body = {23s: val24}25
26console.log(JSON.stringify(body))27
28fetch("./count", {29method: 'post',30body: JSON.stringify(body)31})32.then((response) => response.json())33.then((data) => {34console.log(data)35document.getElementById("get_answer").innerHTML = data.v;36});37}
38