Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a popup only on Close

Status
Not open for further replies.

don320

Programmer
Apr 8, 2005
11
US
I need to create a popup that only closes when someone exits the window, but not when they push the back button of their browser.

Here is the code I am using.
exited = 0;
function popup() {
if(exited)
{
var popurl="herman-popup.html"
winpops = window.open(popurl, "", "width=390 height=490, scrollbars,")
}
}
and I think I need to put some type of statement for windows.history.back() or windows.history.go(-1)
 
Is it possible then to have a popup domain specific. Meaning only when they leave our site?
 
So you saying it is in no way possible to create an if statement that says someting like this:

...
if(exited){If(windows.history.go(-1) (exited=1;)
{
{
var popurl="herman-popup.html"
winpops = window.open
popurl, "", "width=390 height=490, scrollbars,")
}
}


}
 

FYI,

A recent study of prolific internet users showed that 100% were against this type of exit popups, and would strive to not visit sites that utilised them.

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
I'd be one of them!


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top