Results 1 to 3 of 3

Thread: DHTML Window pop up appears once only

  1. #1
    Join Date
    Jul 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default DHTML Window pop up appears once only

    1) Script Title: DHTML Window

    2) Script URL (on DD): http://www.dynamicdrive.com/forums/a...3&d=1200855296

    3) Describe problem: The version of the script that includes the 'sessiononly' variable works beautifully, where the pop up appears once per session.

    Is it possible to configure the script so the pop up window only appears once ever?

    Thanks

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Not exactly, not with this script the way that it is, and not really period in that doing so depends upon cookies and the user could always delete the cookie.

    You could edit the script. Using a text only editor like NotePad, where it has:

    Code:
    	if (typeof sessiononly!="undefined") //set session only cookie?
    		persistobj.setCookie(windowname, "shown")
    	}
    Make that:

    Code:
    	if (typeof sessiononly!="undefined") //set session only cookie?
    		persistobj.setCookie(windowname, "shown", typeof sessiononly === 'number'? sessiononly : '')
    	}
    Then when you're using the open command, instead of specifying true or some string for sessiononly, specify an unquoted number, such as 365, which will set the cookie for a year. Each time the user revisits the page, as long as they have cookies enabled and haven't deleted this one yet, a new 1 year cookie will be set.

    The browser cache may need to be cleared and/or the page refreshed to see changes.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    leonard3107 (10-08-2012)

  4. #3
    Join Date
    Jul 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks very much for the solution, it works great. Apologies for the very late reply, I mislaid all information to this site.

Bookmarks

Posting Permissions

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