Solved

popup window unpon exit of domain only

Posted on 2003-10-29
2
245 Views
Last Modified: 2013-12-24
I need code that make a window popup upon exit of a domain only, not on unload of any one page.


Thanks.
0
Comment
Question by:CFDevHead
2 Comments
 
LVL 12

Accepted Solution

by:
jyokum earned 500 total points
ID: 9647499
admittedly, this is some strange code... but it seems to work


<!--    closeDomain.html   -->
<html>
<head>
<script>
function checkExit(){
      var win = window.open("","","width=10,height=10");
      win.blur();
      win.document.write("<script>");
      win.document.write("setTimeout(\'checkDomain()\',1000);\n");
      win.document.write("function checkDomain(){ ");
      win.document.write("try {");
      win.document.write("if(window.opener) var x = window.opener.location.href;\n");
      win.document.write("self.close();}");
      win.document.write("catch(e){window.alert(\'you left my domain!!!\'); self.close();}");
      win.document.write("}");
      win.document.write("<\/script>");
}
</script>
</head>

<body onunload="checkExit();">
<a href="closeDomain.html">stay at domain</a><br>
<a href="http://www.experts-exchange.com">leave domain</a><br>
</body>
</html>
0
 
LVL 9

Author Comment

by:CFDevHead
ID: 9647517
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ColdFusion Rereplace 3 80
Configure IIS to process JSON 10 80
Web server settings related to keepalive 1 122
Domino Website - Redirection 12 76
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question