Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 4 additions & 22 deletions MyFirstWeb/src/main/webapp/Solution.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
function square_solution() {
var a = document.table.A.value;

$(document).ready(function () {
var a = document.table.A.value;
var b = document.table.B.value;
var c = document.table.C.value;

Expand All @@ -9,25 +10,6 @@
C: c
};
var json = JSON.stringify(coeff);
/*
var xhr = new XMLHttpRequest();
xhr.open("POST", '/solution', true)
xhr.setRequestHeader('Content-type', 'application/json; charset=utf-8');
xhr.onreadystatechange =function () {
// встраиваем функцию проверки статуса нашего запроса
// это вызывается при каждом изменении статуса
if (httpRequest.readyState === 4 && httpRequest.status === 200) {
callback.call(httpRequest.responseXML); // вызываем колбек
}
}
xhr.send(json);
var solution = document.getElementById("square_solution");
var response = xhr.getAllResponseHeaders();
solution.innerHTML = response;*/

}

$(document).ready(function () {
$('#form').submit((event) => {
$.ajax({
url: 'http://localhost:8081/solution',
Expand All @@ -41,4 +23,4 @@
}
})
}
}
}