25 lines
775 B
JavaScript
25 lines
775 B
JavaScript
function AvaliMode() {
|
|
if(!document.getElementById('id1')) {
|
|
var link = document.createElement('link');
|
|
link.id = 'id1';
|
|
link.rel = 'stylesheet';
|
|
link.href = '/assets/style/avali.css';
|
|
document.head.appendChild(link);
|
|
AvaliSet("true");
|
|
} else {
|
|
document.getElementById("id1").remove();
|
|
AvaliSet("false");
|
|
}
|
|
}
|
|
|
|
function AvaliSet(VarIDD) {
|
|
return new Promise(function (resolve) {
|
|
const xmlhttp = new XMLHttpRequest();
|
|
xmlhttp.onload = function () {
|
|
resolve(xmlhttp.response)
|
|
}
|
|
xmlhttp.open("POST", "/setavali.php");
|
|
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
|
xmlhttp.send('avali=' + VarIDD);
|
|
});
|
|
} |