Javascript Prompt()文本在Internet Explorer 11中部分隐藏 [英] Javascript Prompt() text is partially hidden in Internet Explorer 11

查看:158
本文介绍了Javascript Prompt()文本在Internet Explorer 11中部分隐藏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在prompt()框中显示大于正常的文本量。在Internet Explorer 11中调用javascript prompt()函数时,我的大部分文本都被隐藏了。它似乎只支持2行文本。 Chrome,Firefox和Opera似乎运行良好。这似乎只是一个IE问题。

I am trying to display a "larger than normal" amount of text in a prompt() box. When calling the javascript prompt() function in Internet Explorer 11, a large portion of my text is being hidden. It seems to only support 2 lines of text. Chrome, Firefox and Opera seem to work fine. This seems to be just an IE issue.

这是一个演示问题的小提琴: JSFiddle示例

Here is a fiddle that demonstrates the problem: JSFiddle Example

prompt("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum     has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.");

我只能看到这个文字 Lorem Ipsum只是打印的虚拟文字自16世纪以来,Lorem Ipsum一直是业界标准的虚拟文本,当时。其余部分没有显示。

I am only able to see this text "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when". The rest is not displayed.

恐怕我已经知道了答案,但是有没有理由说明这种情况发生了?我更喜欢使用prompt()而不使用自定义模式。

I'm afraid I already know the answer, but is there a reason why this is happening? I would prefer to use the prompt() and not use a custom modal.

推荐答案

您可能不应该使用 window.prompt 开头。由于它阻塞了线程,因此很大程度上不受欢迎,因此可以暂停您的应用程序。今天的网络已经开始利用JavaScript的异步性质;这应该使我们远离 alert 提示等等。

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.

目前,Immersive Internet Explorer(Metro),xbox上的Internet Explorer或Windows Web应用程序(以前称为Windows应用商店应用程序)不支持提示。相反,我们鼓励您利用第三方工具和库(例如Bootstrap,jQuery UI等)来满足这些类型的需求。

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.

所有这些都说,它是Internet Explorer和其他现代浏览器之间的真正区别,因此我在内部为IE团队开辟了一个问题进行讨论。

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.

这篇关于Javascript Prompt()文本在Internet Explorer 11中部分隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆