View Full Version : only opening a pop-up 5 times using cookies
Antoniohawk
08-30-2002, 11:50 PM
I have a pop-up window on my site that loads when you enter the site. Pop-ups can get really annoying, so i was wondering if there was a way that the popup could only appear 5 times to the person. I dont know if this is possible, but i sure hope so. I was also wondering if you could name a cookie so that the people that visit my site would know what cookies not to delete when they clean out the cookies folder. Thx alot
whammy
08-31-2002, 12:26 AM
How about the popup only loads once? (I really hate popups - if I closed it, I sure don't want to see it again!) :)
To do this, you would indeed use a cookie. As for keeping people from deleting them, in my experience if they're going to delete one cookie, they'll definitely delete them all. If they do, it's their fault that the popup comes up again, anyway. Right?
So check out the cookie tutorial on http://www.javascriptkit.com/javatutors/cookie.shtml - it has all the information you need to do this, except how to make the cookie persistent (set an expiration date). In order to do that, you just add an expiration date to the cookie - come back once you have it working session-only, and that's a cinch to add! :D
P.S. And you could easily make it popup only 5 times, if you really want... but I still vote for 1!
Antoniohawk
08-31-2002, 05:01 PM
Thanks alot Whammy. I might need help making it 5 times though let me try out the tut and i will get back to u. :thumbsup:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.