473,396 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1615
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Paul | last post by:
I link to a web site from an Excel spreadsheet. The page i link to is getCookie.asp which sets a cookie then returns back some html which opens a new window, to the same site but a different page...
11
by: Michael B. | last post by:
I'm still learning C so I've written a simple app which lets you make a contact list (stored as a linked list of structs), write it to a file, and read it back. It works fine, but I notice in my...
2
by: moondaddy | last post by:
I have a simple sample site I'm building in asp.net 2.0. I created a master page and a default.aspx content page in the project's root directory. Then I created a subfolder called content and...
7
by: Jed | last post by:
I am trying to open web project in VS 2003 using the File Share method. VS is running on XP Pro (Host) and I am accessing the root web of an XP Pro install on Virtual PC (Server) running on the...
1
by: MelHeravi | last post by:
I need to create a popup with items (small, medium, large) and attach it to a whole bunch of images. Its the same menus for all images. menus should popup around the point on the image where it...
2
by: Anthony Sporetta | last post by:
Hi all I have a page which has an iframe, containing an external site which I have no control over. When someone clicks one of their links inside the iframe, it currently opens that link also...
2
by: news.sbcglobal.net | last post by:
Back in the good old days (or bad old days depending on your point of view) when I used frames to develop some of my web sites, I was able to designate which frame I wanted a page to open in. Now...
6
by: MLH | last post by:
I have a form, frmUSPSReturnReceipts, with a control named NotExpectingGreenTickets. The control's Exit event procedure follows: Private Sub NotExpectingGreenTickets_Exit(Cancel As Integer) If...
7
by: colleen1980 | last post by:
Hi: When i run the same code with minor changes in VB it works fine but when i run in ASP it runs but it not pulling any information from the web site. Needs help Thanks, Anna. ASP CODE ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.