Solved

JavaScript prmpt Window wouldn't hold on IE, Window 7

Posted on 2011-02-13
5
229 Views
Last Modified: 2012-05-11
This follow code contain a javascript prompt example. It workd on local machine, but when it is
uploaded to a website, the Promt window does not display. The IE browser shows on the message bar "this site contains a script and will take data would you allow it  .. ". When I click temperal allow the script prompt, still the prompt window didn't show up. In fact the script is already passed that point, show the next line with the data (name = null).  It is at this site:

http://cs330.blueearthconnections.org/Zhang/Exercise_06_JavaScript_1/User_string_input.html

You can view the source HTML code.  Thanks
0
Comment
Question by:zzhang2006
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 1

Author Comment

by:zzhang2006
ID: 34884391
Thanks
0
 
LVL 4

Expert Comment

by:dailypcguy
ID: 34885923
Okay it was easy really head n  body tags implemented incorrectly; This worked for me in 'weaver preview

Hope it works for you!
<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<!-- Fig. 6.7: welcome5.html -->
<!-- Using Prompt Boxes -->
<html xmlns = "http://www.w3.org/1999/xhtml">
   <head> 
      <title>Using Prompt and Alert Boxes</title>
   </head>
<body>
         <script type = "text/javascript">
         <!--
         var name; // string entered by the user
 
         // read the name from the prompt box as a string
         name = window.prompt( "Please enter your name" );
 
         document.writeln( "<h1>Hello " + name + 
            ", welcome to JavaScript programming!</h1>" );
         //-->
      </script>
   </head>
   <body>
      <p>Click Refresh (or Reload) to run this script again.</p> 
   </body>
</html>
 
 
<!--

Open in new window

0
 
LVL 1

Author Comment

by:zzhang2006
ID: 34889218
dailypcguy,
Unfornunately it didn't work for me, it hangs the broswer
0
 
LVL 4

Accepted Solution

by:
dailypcguy earned 250 total points
ID: 34892315
Interesting. I was using Opera 11 browser actually (It's my default) and I didn't even set up a default site for that page. I can post a acreen shot later maybe. Doesn't that point to document/site relative links as a possible cause? Are you sure that page is in the root folder on the site perhaps.
There is also a superfluous body tag in that code I noticed just now.
I'll check it again...
0
 
LVL 1

Author Closing Comment

by:zzhang2006
ID: 35246181
seems helpful
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to translate this 2-line while loop into C from Perl? 8 165
How to learn Linux? 10 97
maximize the sum of fractions 33 75
Bitwise and to sum elements 2 52
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question