how do you only allow a popup to popup once

D

David Graham

Hi
I use an OnLoad event in the body tag to open a popup window. I would like
to know how to go about only allowing the window to popup once i.e on
subsequent visits to the parent page, the popup np longer pops up. I think
it is irritating to users to have to close the popup everytime they visit
the page. I think I need to set a cookie so that the server knows the
visitor is a return visitor and not a new visitor, but I have no idea how to
write the code. I do know a little php so I could combine php and javascript
if that is the best way to achieve my goal.
thanks
David
 
C

Carsten B.

David Graham said:
Hi
I use an OnLoad event in the body tag to open a popup window. I would like
to know how to go about only allowing the window to popup once i.e on
subsequent visits to the parent page, the popup np longer pops up. I think
it is irritating to users to have to close the popup everytime they visit
the page. I think I need to set a cookie so that the server knows the
visitor is a return visitor and not a new visitor, but I have no idea how to
write the code. I do know a little php so I could combine php and javascript
if that is the best way to achieve my goal.
thanks
David

Set a cookie. Read the cookie. If the cookie exists, don´t show the popup,
else show it.
 
D

David Graham

Carsten B. said:
how

Set a cookie. Read the cookie. If the cookie exists, don´t show the popup,
else show it.
Thanks Carsten - I will read up on this. Can I ask for a few hints as to the
relevant code to carry this out
David
 
S

Stuart Palmer

David, Take a look at yahoo and punch in 'Javascript cookies' you should get
a variety of examples on how to create and read them if they exist.

Stuart Palmer
 
K

kaeli

Hi
I use an OnLoad event in the body tag to open a popup window. I would like
to know how to go about only allowing the window to popup once i.e on
subsequent visits to the parent page, the popup np longer pops up. I think
it is irritating to users to have to close the popup everytime they visit
the page.

Don't worry, most of us have popup killers and don't see it at all.
Unrequested popups are the most irritating thing EVER. So, we just don't
let them pop up at all.


--
~kaeli~
"No matter what happens, somebody will find a way to take
it too seriously."
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top