prompt() with Internet Explorer 8

IE has an setting in Internet Options to allow or deny prompt().

IE prompt setting
(source: adamhaskell.net)

By default in IE8, this setting is off. Consequently, calls to prompt() are ignored and "" is returned by them.

You shouldn't use prompt() anyway. Use a form.


It looks like a security thing specific to IE- 8 for sure, I don't have other versions to test. Calling prompt() produces a warning about a scripted window asking for information. I can click to allow and after refreshing the page, the prompt box appears as expected.

If you are going to insist on using prompt(), you will probably have to stipulate that security settings on the target machines are configured to allow it.


Microsoft developer website tells us that "prompt()" is deprecated and now normally blocked for security reasons: "By default, this method is blocked by the information bar in the Internet zone. This helps prevent malicious sites from initiating spoofing attacks. "

See http://msdn.microsoft.com/en-us/library/ms536673.aspx