473,325 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

(!stay) in a tutorial

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

Sep 29 '05 #1
3 1422
stay is not a reserved word

When you say you replaced "stay", did you replace it in both:-

if (!remain)...

AND

var remain=confirm(...

?

Sep 29 '05 #2
"Dung Ping" <du*******@yahoo.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.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){
Sep 29 '05 #3
I was stupid and careless. I thought I had discovered a miracle word,
and posted a stupid question to the forum. The 'stay' was there. I
simply didn't see it.

Thanks a lot and I am sorry for the annoyance.

Dung Ping

McKirahan wrote:
"Dung Ping" <du*******@yahoo.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.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){


Sep 29 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Colin Kingston | last post by:
Hi I have reasonable experience with access. I am just about to start a web based database project for my computer course. I have very very limited experience of frontpage, VB & VB script, I...
21
by: Alf P. Steinbach | last post by:
Just because there seems to be a lack of post-standard _correct_ tutorials: <url: http://home.no.net/dubjai/win32cpptut/>. Disclaimer: written this evening so perhaps there are "bugs" in the...
15
by: binnyva | last post by:
Hello Everyone, I have just compleated a JavaScript tutorial and publishing the draft(or the beta version, as I like to call it) for review. This is not open to public yet. The Tutorial is...
19
by: Mike Cox | last post by:
Has anyone created something like that for Postgresql? It would be really handy to encrypt credit card numbers and other information so it stays secure. If no one has created anything such as...
2
by: Michael B. Trausch | last post by:
I've been searching for a little while (about the past week or so) and not finding anything really close to what I'm looking for. I have an application that I've writting that, as of this point in...
11
by: Magnus Lycka | last post by:
While the official Python Tutorial has served its purpose well, keeping it up to date is hardly anyones top priority, and there are others who passionately create really good Python tutorials on...
11
by: Sheridan | last post by:
Dear Group, I've searched the newsgroup for the last few days and can't seem to find a thread regarding the best tutorials. I've learned programming in C, VB (version 6) and PHP but can't seem to...
37
by: Zabac | last post by:
I am attempting to learn C on a computer that does not have internet access. Can anyone find a C tutorial that can be completely downloaded? I wish to transfer it from a computer that can get...
5
by: FFMG | last post by:
Hi, Seen that support for PHP4 will be dropped at the end of the year I was thinking that maybe now might be a good time to start moving things. Is there a tutorial as to what I need to look...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.