469,951 Members | 2,392 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,951 developers. It's quick & easy.

Want Exit Popop Not to open inside the same site

I am using the code below to implement 1 time entry and exit popup.
The entry popup works fine, but the exit popup opens even if you
browse from one page to the other on the same site. I want it to popup
only if the user closes the browser or goes to a different site.

What is the best way to implement this ?
var isNN, isIE, loadURLs=new Array(), loadTimes=new Array(), exitURL,
loadURLno=0, scriptID, cookieVRFY;
var exit = true;

//set by user
scriptID='nrScript';
cookieVRFY=1;

AddLoad('entry.asp',1);
//AddExit('exit.asp');
function AddLoad(sURL,iTime)
{
loadURLs[loadURLno]=sURL;
loadTimes[loadURLno]=iTime;
loadURLno++;
}
function AddExit(sURL)
{
exitURL=sURL;
}

if (parseInt(navigator.appVersion) >= 4) {
if (navigator.appName == "Netscape") {
isNN = true;
} else {
isIE = true;
}
}

function errorIgnore(e) { return true; }
function openLoadWin() {
var oldtime=0,mywins;
for (mywins=0;mywins<loadURLno;mywins++)
{

var winLeft = (screen.width)/3;
var winTop = (screen.height)/3;
setTimeout("window.open('" + loadURLs[mywins] + "','Loadwin" + mywins
+ " ','width=350,height=200,top=0,left=0,scrollbars=no
,top = " + winTop + ", left = " + winLeft +"' );self.focus();"
,(oldtime+loadTimes[mywins])*1000+10);
oldtime+=loadTimes[mywins];
}
return true;
}
function openExitWin() {
if (exitURL!='')
{
var ExitWin = window.
open(exitURL,'ExitWin','width=350,height=200,top=0
,left=0,scrollbars=yes');
self.focus();
}
return true;
}

if ( (cookieVRFY!=1) || (document.cookie.indexOf( scriptID+'PopupPRO='
)==-1) )
{

window.onerror = errorIgnore;

if (isNN) {
document.captureEvents(Event.UNLOAD | Event.LOAD | Event.ERROR |
Event.CLICK);
}

openLoadWin();
//window.onunload=openExitWin;

if (cookieVRFY==1){
document.cookie=scriptID+'PopupPRO=HeyGuys!;path=/';
}
}
Jul 19 '05 #1
1 1514
http://www.aspfaq.com/5001

Ray at work

"deepak" <de*********@hotmail.com> wrote in message
news:61**************************@posting.google.c om...
I am using the code below
if (parseInt(navigator.appVersion) >= 4) {
if (navigator.appName == "Netscape") {

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Michael B. | last post: by
7 posts views Thread by Jed | last post: by
1 post views Thread by MelHeravi | last post: by
2 posts views Thread by Anthony Sporetta | last post: by
7 posts views Thread by colleen1980 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.