minor fixes

This commit is contained in:
nikili0n
2023-09-26 01:07:44 +03:00
committed by Dantenerosas
parent ad3c7450fb
commit 337885746d
3 changed files with 18 additions and 10 deletions

View File

@ -93,8 +93,10 @@
const link = document.getElementById("link").value
const xhr2 = new XMLHttpRequest();
// TODO: скорректировать ссылку, она должна быть относительной
xhr2.open('POST', 'http://'+document.location.host+'/check');
xhr2.open('POST', 'http://'+document.location.host+'/check/');
xhr2.responseType = 'json';
xhr2.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
xhr2.onload = function() {
// TODO: добавить обработку исключений и всех возможных кодов в ответе
if (xhr2.status !== 200) {
@ -112,9 +114,10 @@
document.forms.download.querySelector('.submit-spinner').classList.add('submit-spinner_hide');
};
};
body = {};
body.link = link;
xhr2.send(body)
var params = {
"link":link,
};
setTimeout(function() { xhr2.send(JSON.stringify(params));}, 1000)
}