Click to See Complete Forum and Search --> : Editing "Pop-up-only-once"


Jesper Brantber
01-25-2003, 02:54 PM
Hi,
I'm trying to edit the javascript "pop-up-only-once" to be able to use the same script on several pages, showing different pop-ups on 'every' page.

Is there anyone out there that know how to proceed?

The script i'm trying to use is located at http://javascript.internet.com/cookies/only-popup-once.html

What I want to do, is to make the script display different messages (pop-ups) depending on which page the viewer access. I don't know anything about javascripts, but as I understand it, I must alter the way the script sets the cookies.

As it is now, I use the script on my index-page to display a pop-up containing information about my newsletter, but I want to use the same script on different pages to display pop-up-ads, but I want the visitors who already have accessed the index-page to se the new pop-up-ads. Anyone following me...???

If so, please reply if You get my point...

Thanks!

Jesper Brantber
01-25-2003, 05:28 PM
Hi Dave!

Thanks for Your reply!

Ok, I'm sitting here in Sweden, and it's getting late night here (I may be a little tired ;-))

I took a quick check at your website, but at this late time I didn't have the energy to browse thru it... (sorry)

But, regarding the script, I need to have it for about 5 to 10 pages, and as i dont know anything about javascripts, I would preffer the "easy" way :D

I don't know if I made my point in my previous entry, but what I want to do is to adjust the script so that it sets a new cookie for at least two or three pages. Say a person loggs in to my index, then the first cookie will be activated, then this person goes to 'page2', then I want this person to be shown a new pop-up, but if the same person revisits the same pages, I don't want the pop-ups to be shown again.. OK??

If You, Dave, has a solution that a novice like me can use, please feel free to post a new message or mail me direct at info@brantbergs.com

Thanks!


And my apologises if my school-english isn't very good...!

slynx
01-25-2003, 10:39 PM
Are you wanting to keep information for repeat visits to your site over time? Or are you only interested in having different popups for repeat visits to the same pages in a single session?

if it's the latter ....
Instead of bothering with cookies, why don't you use an invisible "frame" with your script in the parent. Make an array of all the pages you want to pop up (popup[i]), use a variable (i) that increments each time the script is called, and open the window based on the number (i) in the array. Then you will get a new popup no matter how many times a person visits the same page or different pages.

Jesper Brantber
01-26-2003, 06:06 AM
Ok! I thought it would be something like that. But as I'm not a master of scripts, I must ask this as well:
In the script at http://javascript.internet.com/cookies/only-popup-once.html is it the 'name' that I have to change in all lines where it appears?

And slynx; Yes I want to use the cookies for more than the session. But your idea was interesting!

Jesper Brantber
01-26-2003, 08:57 AM
OK! I will try this!

Many thanks :) :)