Connecting Tech Pros Worldwide Forums | Help | Site Map

Javascript to stop back button from causing popup

Newbie
 
Join Date: Mar 2007
Posts: 1
#1: Mar 2 '07
We are coding a popup window on exit of our site. We do not want this popup to occur if someone hits the back button. How do we stop this. Any hints?

Ganon11's Avatar
Moderator
 
Join Date: Oct 2006
Location: New York, United States of America
Posts: 3,428
#2: Mar 2 '07

re: Javascript to stop back button from causing popup


You'll have better luck looking in the Javascript forum.
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#3: Mar 2 '07

re: Javascript to stop back button from causing popup


Quote:

Originally Posted by Ganon11

You'll have better luck looking in the Javascript forum.

Moved to Javascript forum.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: Mar 2 '07

re: Javascript to stop back button from causing popup


Quote:

Originally Posted by tess

We are coding a popup window on exit of our site. We do not want this popup to occur if someone hits the back button. How do we stop this. Any hints?

Welcome to The Scripts and the Javascript forum (where you've been directed to!)

Show your code. I'm assuming you're using onunload to display the popup window.

One thing is that for a website on the internet, it is bad practice to show a popup when exiting a site. It's annoying for the user and popup blockers will probably block it anyway. If, however, it's for specific users and they expect the popup, then of course there's no problem.
Reply


Similar JavaScript / Ajax / DHTML bytes