?
Solved

popup window unpon exit of domain only

Posted on 2003-10-29
2
Medium Priority
?
250 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
jyokum earned 2000 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

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

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

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month12 days, 10 hours left to enroll

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