[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

popup window unpon exit of domain only

Posted on 2003-10-29
2
Medium Priority
?
251 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

656 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