prompt() to request a number. The idea was that you have a table full of numbers, and want to change one. So, you click it, and a
prompt() asks for the replacement number.
In Firefox, the prompt is a small modal window which has an ugly title saying something like “The page at http://localhost/…”.
So, I wanted to know is there a way to avoid it. I was hoping that
prompt(question,value) had a secret third parameter that set the title.
prompt() that I have no idea why the person bothered writing anything at all.
You can use a prompt for a wide variety of useless tasks, but below we use it for an exceptionally silly task.
By the way, you’ve made a few incorrect statements.
Ever heard of Ajax? It involves a lot of user interaction. That sometimes involves requesting a value from the user. The way you do that is
prompt(). Now, you /could/ write your own custom version of
prompt(), but when it comes down to it, that’s just a prettier version of something that you claim is a relic.
Except for those very common cases where you might require input of a single value.
many find it slightly annoying
but hey, this tutorial is here to educate you
If education means teaching to sneer, belittle, and misunderstand, then you are correct.
No! The “point” of
prompt() is in its name – it prompts the user for a value. What you do with the value afterwards is of no bearing at all to the function itself.
By the way, your “tutorial” doesn’t even say what the two parameters of
No luck on the prompt unless you want to hack with some DHTML popup or use the VBScript MsgBox in IE.
Speaking of IE, if you think that the Firefox version of prompt() is a tad ugly, you haven’t seen anything! Check out this post on IE’s epic fail of prompt()
I hope you replied to this section:
Found Something Wrong in this Lesson?
If you want to go with Kyle’s recommendation of the VBScript MsgBox I see that tizag has a tutorial on it aswell!:-)
I don’t think its a good idea due to its lack of support for anything but IE