This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
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: 41129
    
  45
What is it supposed to do, and what does it actually do?


Ping & DNS - my free Android networking tools app
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: 60785
    
  65

So what's the issue?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by 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: 41129
    
  45
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: 60785
    
  65

In fact, why are you writing the document in writeln's to being with?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem with window.prompt
 
Similar Threads
Beginner Java Question
Rounding off $$ amounts
calculating form fields
JavaScript reverse integer (?)
Help wit h code