简体   繁体   English

Javascript提示框字段大小限制

[英]Javascript prompt box field size limit

3363 is the size of my string that will be displayed but the limit of chars it can show is 2000. 3363size of my string将显示的size of my stringsize of my string但它可以show limit of chars2000.

Is there anyway around this superficial limit? 反正这种肤浅的限制吗?

  window.prompt("Copy to clipboard: Ctrl + C" ,   
                 document.getElementById("codeArea").value);

How can I make a dialog that lets me set the size limit for the field? 如何创建一个允许我设置字段大小限制的对话框? Thanks 谢谢

This is implementation dependent and not in the spec. 这是依赖于实现的,而不是在规范中。 So every browser has a different limit here i suppose. 所以我想每个浏览器都有不同的限制。 And no, there is no way to change that. 不,没有办法改变这一点。 It is bad UI anyway to do it so big. 无论如何,做这么大的UI都是糟糕的。 Make a dialog in html instead. 改为在html中创建一个对话框。 Even a modal one if needed. 如果需要,甚至是模态的。

AS far as windows.prompt is concerned it is not possible to change config parameter such as size. 就windows.prompt而言,无法更改大小等配置参数。

Either you can write your own prompt box or you can use jquery dialog like this http://jqueryui.com/dialog/ 您可以编写自己的提示框,也可以使用jquery对话框,如http://jqueryui.com/dialog/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM