This commit is contained in:
nikili0n
2023-09-25 17:43:24 +03:00
committed by Dantenerosas
parent 8bd1463401
commit ef9dc04458
3 changed files with 21 additions and 3 deletions

View File

@ -92,10 +92,11 @@
document.forms.download.querySelector('.submit-spinner').classList.remove('submit-spinner_hide');
const link = document.getElementById("link").value
const xhr2 = new XMLHttpRequest();
// TODO: скорректировать ссылку, она должна быть относительной
xhr2.open('GET', 'http://0.0.0.0:8000/check/?link=' + link);
xhr2.responseType = 'json';
xhr2.onload = function() {
// TODO: добавить обработку исключений и всех возможных кодов в ответе
if (xhr2.status !== 200) {
if ('response' in xhr2 && xhr2.response !== null) {
console.log(xhr2.response)