minor fixes
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user