Results 1 to 8 of 8

Thread: Sticky Note persistence issue

  1. #1
    Join Date
    Sep 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Sticky Note persistence issue

    1) Script Title: Sticky Note

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...stickynote.htm

    3) Describe problem: I'm using the script on many pages within my site, and with the frequency set to once per session it only shows up on the first page the visitors goes to. For all the other pages it doesn't show up. I definitely can't have it show up on every page every time. I've put a lot of effort into getting it all configured. I assumed that each page set a different cookie. Please tell it is designed to accommodate logical use on more than one page on a site.

  2. #2
    Join Date
    Sep 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I have a different message on each page. Each one must show up, and only once

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    The script uses the ID of the Sticky Note DIV to construct the cookie's name (which in turn is domain wide), so if the ID of your sticky note DIVs are the same across two or more pages, the persistence of one sticky note will affect the others' as well.

    Try the below modified .js file, which should force each page to store its own persistence cookie value, by adding the page's URL as part of the cookie's name (so there theoretically won't be any duplicate names for different pages).
    DD Admin

  4. #4
    Join Date
    Sep 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much for taking the time to do that. Would I get the same result if I manually change the ID of each div? Do you advise one approach over the other?

    Thanks

  5. #5
    Join Date
    Sep 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I tried the modified script but with no luck. I will try changing the IDs

  6. #6
    Join Date
    Sep 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hmmm, that didn't work either. All pages were using

    <div id="stickynote1" class="stickynote">

    and

    var mysticky=new stickynote({
    content:{divid:'stickynote1', source:'inline'},

    and I change it to stickynote2 in both cases on one test page, but no luck. Is there more to it? I tried this with the old and new js.

    Thanks
    Last edited by bceugene; 09-11-2011 at 11:55 PM.

  7. #7
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hmm testing the script with the modified .js file at a glance works for me. Initializing two identical sticky boxes on two separate pages locally using the initialization code:

    Code:
    var mysticky=new stickynote({
    	content:{divid:'stickynote1', source:'inline'},
    	showfrequency:'session',
    	hidebox:5
    })
    Each sticky note displayed once per browser session before not showing up again, versus only one of the two before both not showing up. The only possibility I can see of this not working for you is if your pages' URL structure is such that the script cannot create a unique string out of each one (which is unlikely).

    Would I get the same result if I manually change the ID of each div? Do you advise one approach over the other?
    Yes, that should definitely work. Do you have a URL to the problem pages?
    DD Admin

  8. #8
    Join Date
    Sep 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It works now. My main menu links are written folder/ and not folder/index.html. I do this to keep the address bar tidy, but it was preventing your modified script from working. The method of changing the div ids still doesn't work for me.

    Thanks
    Last edited by bceugene; 09-12-2011 at 08:31 PM.

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
  •