This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
uwu-me/uwume/static/js/home/index.js

27 lines
No EOL
706 B
JavaScript

const getCurval = function() {
const xhttp = new XMLHttpRequest();
xhttp.withCredentials = true;
xhttp.onreadystatechange = updateUwuCounter;
xhttp.open("GET", window.location.href + "/getCurval", true);
xhttp.send();
};
const updateUwuCounter = function() {
const uwu_counter = document.getElementById("uwu-counter");
if (!this.response) {
uwu_counter.textContent = uwu_counter.textContent;
} else {
try {
uwu_counter.textContent = this.response;
} catch (error) {
console.log(error);
console.log(response);
}
}
};
window.addEventListener("load", function() {
console.log("View specific JS initialized.");
this.setInterval(getCurval, 5000);
});