473,793 Members | 2,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

(!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 1441
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*******@yaho o.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.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*******@yaho o.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.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
4531
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 have no experience of ASP or dreamweaver. I have office xp pro and am in the process of buying and installing win xp pro. Is there anything else I need?
21
4119
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 presentation -- are there? Plea: if someone takes the time to convert the word document to clean xhtml perhaps with stylish clear readable layout, then it will be an incentive for me to go on to write a next part, and a next part...
15
4233
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 avaliable at... http://www.geocities.com/binnyva/code/javascript/advanced_tutorial/ If any of you could spare the time, please have a look at my tutorial
19
18635
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 this, I am going to code up something quite soon, but if it already exists, there is no need for me to reinvent the wheel, so speak up! It is a law in places such as the EU that many types of data must be encrypted if the database is compromised.
2
4191
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 time, is a "traditional" web application. Meaning, that it's the regular application in the sense that the user does some data entry, sends the request to the server for dome processing, and another page comes up and displays the result and...
11
2937
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 the web. I think 'A Byte of Python' by Swaroop C H is a good beginners tutorial, and 'Dive Into Python' by Mark Pilgrim is a good tutorial for more experienced programmers.
11
1139
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 understand ASP.Net or VB.Net (their web-type programming). Gone to the Microsoft site with the tutorials in video format but still can't 'get it'. Not sure what all the files are that need to be deployed nor even the actual model(MVC?) that the...
37
8267
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 online to my computer. (The one that can not get on the internet.) I don't need an absolute beginner tutorial, as I have used Python before. Thanks! - Ian Shearin
5
2367
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 out for? And, Could I run both version on my test server? Or do I need to have to Apache servers running?
0
10211
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9033
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.