PDA

View Full Version : Sticky Note persistence issue



bceugene
09-10-2011, 04:15 PM
1) Script Title: Sticky Note

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/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.

bceugene
09-10-2011, 07:50 PM
I have a different message on each page. Each one must show up, and only once

ddadmin
09-11-2011, 08:29 AM
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).

bceugene
09-11-2011, 11:42 PM
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

bceugene
09-11-2011, 11:46 PM
I tried the modified script but with no luck. I will try changing the IDs

bceugene
09-11-2011, 11:48 PM
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

ddadmin
09-12-2011, 06:31 PM
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:


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?

bceugene
09-12-2011, 08:16 PM
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