Click to See Complete Forum and Search --> : Stop repeating
Midranger
02-06-2006, 11:52 AM
Pardon my ignorance..I'm very new at this. My question is, How do you prevent a function executing each time a page is loaded. For ex. greeting msg or alert that pops up upon entering a site, how can it be prevented from poping back up each time the visitor refreshes or returns to that particular page?
cbrookes
02-06-2006, 11:57 AM
Couple of basic approaches:
1. Client-side you can store the fact that the popup has been displayed in a cookie - and then adjust your code to check the cookie before displaying it again.
2. On the server-side you can store the state in the session (exactly where that is depends on which server-side technology you are using) and then pass the state into the page so that it supresses the popup when it reaches the client.
Midranger
02-06-2006, 12:24 PM
Thank you very much!!!!!
The client side method is just what I was looking for and works great!!
Thanx again and take care!!
cbrookes
02-06-2006, 12:35 PM
My Pleasure!