I want to show popup only once, and I have already written code for it but it is not working.
I want to execute did_you_know_slide_in() function only once.
Can anyone guide me what i am doing wrong.
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function loadornot(){
if (get_cookie('hasSeen')==''){
document.cookie="hasSeen=yes"
did_you_know_slide_in();
}
}
loadornot();