Link to home
Start Free TrialLog in
Avatar of zzhang2006
zzhang2006Flag for United States of America

asked on

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

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:

You can view the source HTML code.  Thanks
Avatar of zzhang2006
Flag of United States of America image


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"
<!-- Fig. 6.7: welcome5.html -->
<!-- Using Prompt Boxes -->
<html xmlns = "">
      <title>Using Prompt and Alert Boxes</title>
         <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>" );
      <p>Click Refresh (or Reload) to run this script again.</p> 

Open in new window

Unfornunately it didn't work for me, it hangs the broswer
Avatar of dailypcguy
Flag of Australia image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
seems helpful