website/js/cookie.js

23 lines
668 B
JavaScript
Raw Normal View History

2020-10-13 17:11:32 +02:00
function acceptCookie(){
document.cookie = "cookieMessageHide=1";
checkHide();
}
function getCookie(name){
var nameEQ = name + "=";
var ca = document.cookie.split(";");
for (var i=0; i < ca.length; i++) {
var c = ca[i];
while(c.charAt(0) === " ") c = c.substr(1, c.length);
if(c.indexOf(nameEQ) === 0) return c.substr(nameEQ.length, c.length)
}
return null
}
function checkHide(){
if (getCookie("cookieMessageHide") === "1"){
document.getElementsByClassName("cookieinfo")[0].style.display = "none";
} else {
document.getElementsByClassName("cookieinfo")[0].style.display = "block";
}
}