Skip to content

Instantly share code, notes, and snippets.

@Patrizio
Created December 14, 2012 09:49
Show Gist options
  • Save Patrizio/4284168 to your computer and use it in GitHub Desktop.
Save Patrizio/4284168 to your computer and use it in GitHub Desktop.
Removed the go_to-variable
<script type="text/javascript" language="JavaScript">
// page to go to if cookie exists
num_days = 30;
function ged(noDays){
var today = new Date();
var expr = new Date(today.getTime() + noDays*24*60*60*1000);
return expr.toGMTString();
}
function readCookie(cookieName){
var start = document.cookie.indexOf(cookieName);
if (start == -1){
document.cookie = "seenit=yes; expires=" + ged(num_days);
} else {
HideContent('survey_holder');
}
}
readCookie("seenit");
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment