This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Problem with window.prompt Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Problem with window.prompt" Watch "Problem with window.prompt" New topic
Author

Problem with window.prompt

Albert Hopkins
Greenhorn

Joined: Jul 21, 2007
Posts: 21
Hi..
can anybody show me whats wrong with this script??

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
What is it supposed to do, and what does it actually do?


Android appsImageJ pluginsJava web charts
Albert Hopkins
Greenhorn

Joined: Jul 21, 2007
Posts: 21
It calculates total price based on the quantity entered by the user.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56192
    
  13

So what's the issue?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Albert Hopkins
Greenhorn

Joined: Jul 21, 2007
Posts: 21
when I open it in IE or Firefox, only blank page appears. No window prompt for user input.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
All the code is in the document head, when it should be in the body. Or, even better, define it in functions in the head, which you then call from the body. I'm not sure it's possible to call document.writeln after the document has been laid out, though; probably not.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56192
    
  13

In fact, why are you writing the document in writeln's to being with?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with window.prompt
 
Similar Threads
Help wit h code
JavaScript reverse integer (?)
calculating form fields
Beginner Java Question
Rounding off $$ amounts