473,503 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why won't windows.alert work?

103 New Member
I am learning javascript with help of tutorials and have typed this simple code.
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <title>Windows and Window Properties</title>
  4.  
  5. <script language ="javascript">
  6. Response ="";
  7. while((Response=="")||(Response =="<undefined>")){
  8.     Response=window.prompt("Please Enter your Name");
  9. }
  10. if(response == "undefined")
  11.     {
  12.     window.alert("Hello, Welcome to our page!");
  13.     }
  14. else 
  15. {
  16.     window.alert("Hello, " + Response + "! Welcome to our page!");
  17. }
  18. document.write("<br> THis is the content of the window.html page: <br>")
  19. </script>
  20.  
  21. </body>
  22. </html>
When I run the page in Chrome, IE, and Firefox the window.prompt works as should. The rest of the code fails. It should alert me either of the two alerts depending if the user enter a name, but it does nothing nor does it do the document.write. Any suggestions or answers would be greatly appreciated.
Jan 6 '12 #1
3 1999
drhowarddrfine
7,435 Recognized Expert Expert
'Response' is not the same as 'response'. I'm sure there is also an issue with 'undefined' and how you equate it but I'm on the run.
Jan 6 '12 #2
Brian Connelly
103 New Member
Thanks for the oversight on Response, I fixed that. But still no luck on moving forward.
Jan 6 '12 #3
Brian Connelly
103 New Member
You were correct. It was just some formatting errors.
Jan 7 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

12
2155
by: Ali | last post by:
I have the following web page with a script in it. <html> <head> <title>Make Your Own Objects test</title> <script>
20
2976
by: David | last post by:
I have seen postings that indicate some developers are creating PHP apps for a Windows server environment. I am not sure if they run underr IIS or Apache, but I wonder why Windows and PHP vs. the...
4
2252
by: MC | last post by:
Hi I have decided cause I am fed up of re-creating code that does the same thing over and over again for various websites, I thought i'd try to write a DLL and have done so in Visual Studio 2005...
1
2662
by: chinimimita.hernandez | last post by:
Does anyone know how windows service work with notifyicon and contextmenu? I was able to run the windows service with notifyicon part but when I inserted the contextmenu command it didn't work....
0
1344
by: manuel | last post by:
hello, sorry for my bad english, and happy christmas. como se pueden capturar las ventanas alert y prompt desde axWebBrowser? thanks
4
21463
by: brandon | last post by:
Anybody out there know how I could go about handling, in a systray'd app, the windows message that the desktop is going to be locked? This way the application can react whenever the Win+L or...
3
5196
by: Miriam | last post by:
Hello, I created a Windows Service in VB.NET, which is to purge files periodically in the local system and also in the shared network drive. Here is my problem: 1. If I set the “Account”...
0
1018
by: Chris Yiu | last post by:
I have written a software delveloped by vb.net. it works fine in windows xp pro both in traditional chinese and english version. However, the UI displays totally different in simplified chinese...
3
4175
by: teser3 | last post by:
I have the below that limits the textarea input to 500 characters but cant get the alert message to work. It doesnt show anything. Please advise. <script language="javascript"...
1
1694
by: kburton89 | last post by:
import javax.swing.JOptionPane; import java.util.*; public class Assignment1 { // do nothing constructor public Assignment1() {} public static void main(Stringargs)
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7353
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...
0
5596
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 projectplanning, coding, testing,...
0
4689
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...
0
3180
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...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
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 ...

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.