Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2003
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I do this?

    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>

  • #2
    Regular Coder
    Join Date
    Mar 2003
    Posts
    176
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try this:
    Code:
    function loadornot(){
    var expireDate=new Date()
    expireDate.setMonth(expireDate.getMonth() + 1)
    	if (get_cookie('poppedup')==''){
    		openpopup()
    		document.cookie= "poppedup=yes; expires="+expireDate.toGMTString()
    	}
    }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •