Re: Java Script Message

by "Cyanide _7" <leo7278(at)hotmail.com>

 Date:  Thu, 18 May 2000 11:20:38 CDT
 To:  ilya788(at)inter.net.il
 Cc:  hwg-languages(at)hwg.org
  todo: View Thread, Original
>         Yeah,  and when you resize the window in Netscape, the damn thing
>thinks you're leaving, too.
>				Yours, Ilya.

grrrr, what *bugs* me the most about this bug is i've never seen it in 
action!! i've never had an onunload event handler fire when resizing in any 
version of netscape i've used! does the content of the doc have anything to 
do with it? in any case, try this for a workaround:

add this to the scripts:

var falseAlarm = false;
function resizing(){
  falseAlarm = true;
}

change function goodbye to say:

function goodbye(){
  if(!staying && !falseAlarm)
    alert("Good bye!");
  else
    falseAlarm = false;
}

and add this to the BODY tag:

onResize="resizing();"

damn i hate bugs. how on earth do they miss these things in beta testing?!?

- Cyanide_7

>>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>
>
>

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

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