Javascript Prompt() text is partially hidden in Internet Explorer 11

强颜欢笑 提交于 2019-12-05 04:27:45

You should probably not use window.prompt to begin with. It is largely frowned upon due to the fact it blocks the thread, and thus can halt your application. The web today has moved towards leveraging the asynchronous nature of JavaScript; this should distance us from things like alert, prompt, etc.

Presently the prompt is not supported in Immersive Internet Explorer ("Metro"), Internet Explorer on the xbox, or Windows Web Applications (formerly Windows Store Applications). Instead, you are encouraged to leverage third-party tools and libraries (such as Bootstrap, jQuery UI, etc) for these types of needs.

All of this being said, it is a genuine difference between Internet Explorer and other modern browsers, and as a result I have opened up an issue internally for the IE team to discuss.

The IE version of prompt does not dynamically resize.

You should only be using prompts for small messages, not whole paragraphs. like

e-mail:

or

username:

You should have any explanation stuff inline on the web page. or better yet don't use prompt's at all and use inline forms.

You can use one of these alerts, even simpler than modals:

If you use Bootstrap, Bootboxjs is for you: http://bootboxjs.com/

Sweetalert is also simple and cool: http://tristanedwards.me/sweetalert

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!