Solved

popup window unpon exit of domain only

Posted on 2003-10-29
2
243 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now