简体   繁体   中英

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.

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. Make a dialog in html instead. Even a modal one if needed.

AS far as windows.prompt is concerned it is not possible to change config parameter such as size.

Either you can write your own prompt box or you can use jquery dialog like this http://jqueryui.com/dialog/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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