ariketa-02/public/js/script.js

20 lines
542 B
JavaScript
Raw Normal View History

2021-03-28 15:58:49 +02:00
function getCookie(name) {
var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
return v ? v[2] : null;
}
var logged = document.getElementById('logged');
var unknown = document.getElementById('unknown');
if(document.cookie.includes("username")){
console.log(getCookie('username'));
logged.style.display= 'block';
unknown.style.display = 'none';
2021-04-07 11:21:35 +02:00
document.getElementsByTagName('h1')[0].innerHTML = "Kaixo " + getCookie('username') + "!!";
2021-03-28 15:58:49 +02:00
}else{
logged.style.display = 'none';
unknown.style.display = 'block';
}