...

View Full Version : How do I do this?



phenom
04-02-2003, 05:25 PM
Below is the closest thing to what i need.
However, instead of popping once per user session I want it to pop every 30 days, how do I set this???

Thanks!
David

<script>

//Popup Window Script
//By JavaScript Kit (http://javascriptkit.com)
//JavaScript tutorials and over 400+ free scripts

function openpopup(){
var popurl="thankyou.htm"
winpops=window.open(popurl,"","width=400,height=338,")
}

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
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function loadornot(){
if (get_cookie('poppedup')==''){
openpopup()
document.cookie="poppedup=yes"
}
}

loadornot()
</script>

HairyTeeth
04-03-2003, 12:10 AM
try this:


function loadornot(){
var expireDate=new Date()
expireDate.setMonth(expireDate.getMonth() + 1)
if (get_cookie('poppedup')==''){
openpopup()
document.cookie= "poppedup=yes; expires="+expireDate.toGMTString()
}
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum