Re: Java Script Message

by Ilya Dubinsky <ilya788(at)inter.net.il>

 Date:  Thu, 18 May 2000 18:01:17 +0200
 To:  "Cyanide _7" <leo7278(at)hotmail.com>
 Cc:  hwg-languages(at)hwg.org
 In-Reply-To:  hotmail
  todo: View Thread, Original

>the technique that most porn sites use is legnthly and a pain in the arse, 
>but it works. the problem is, you want to know if they are leaving your 
>site, or merely following a link. try this:
>
><!-- in the HEAD -->
><script>
><!--
>var stay = false;
>function goodbye(){
>  if(!staying)
>    alert("Good bye!");
>}
>function stay(){
>  return (staying = true);
>}
>//-->
></script>
>
><!-- in the BODY tag -->
>onUnLoad="goodbye();"
>
>then from each link on your page that links to another page on your site, 
>you add an onClick event handler to the link:
>
><!-- in the (A)nchor tag -->
>onClick="return stay();"
>
>on links that leave your site, you just use regular links. if they enter a 
>new URL or click a link to leave, then your message is displayed. - Cyanide_7
>
>>
>>From: <RHessel281(at)aol.com>
>> > I'm looking for the code that will give you a message when you click
>>through
>> > to leave one site to enter another one.  Maybe a message like "You are now
>> > leaving ......... site"
>>
>><a href="somewhere.html" onClick="alert('you are leaving this
>>site');">somewhere else</a>

         Yeah,  and when you resize the window in Netscape, the damn thing 
thinks you're leaving, too.


				Yours, Ilya.

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA