"Dung Ping" <dungping5@yahoo.com> wrote in message
news:1128012612.499609.186020@g14g2000cwa.googlegroups.com...
> I came across following code in a tutorial. I originally thought the
> word 'stay' in (!stay) was not important, and could be replaced by
> another word. The negation mark (!) was doing the whole work. But when
> replacing the 'stay' with another word, such as 'remain', the if
> conditional did not work.
>
> As far as I know, 'stay' is not a reserved word, and is not defined in
> the code, either. How come it is a must?
>
> <html>
> <head>
> <script type='text/javascript'>
>
> var stay=confirm ("The following site contains appalling material
> suitable only for webmasters. Please 'ok' to enter, 'cancel' to exit
> immediately!")
>
> if (!stay){
> window.location="http://www.yahoo.com"
> }
> </script>
> </head>
> <body>
> Appalling material here
> </body>
> </html>
>
> The web page is in:
> http://www.pinyinology.com/learning/stay.html
>
> Thanks.
> Dung Ping
Did you replace all (both) uses of "stay"?
var stay
if (!stay){
Received on Tue Oct 18 03:32:52 2005