TextArea中的大文本会冻结计算机 [英] Large text in TextArea freezes computer

查看:102
本文介绍了TextArea中的大文本会冻结计算机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用大文本(例如,字符串长度为600000)设置textarea的值时,浏览器(Firefox 3.5.3)冻结。

文本在1行,所以文本包装需要由textarea本身发生。我认为这会导致这个问题。



有人知道这个问题的解决方法吗?

解决方案

Firefox中的 textarea 的最大大小为64K(可能只有32K,我不记得)。 600,000个字符大于此值。如果您粘贴到 textarea 中的文本的大小实际上超过了该大小,则会有没什么可以做的。



当然,另一种方法是对进入现场的数据进行某种限制,然后给用户一些反馈,为什么他们的数据不适合。


When I try to set the value of a textarea with a large text (for example a string length of 600000), the browser (Firefox 3.5.3) freezes.

The text is in 1 line so text wrapping needs to happen by the textarea itself. I think this causes the problem.

Does anyone know a fix for this problem?

解决方案

The maximum size for a textarea in Firefox is 64K (it could be just 32K, I can't recall). 600,000 characters is larger than that. If the size of the text that you're pasting into the textarea does in fact exceed that size, then there's nothing you can do about it.

Of course, one alternative would be to put some type of restriction on the data going into the field and then give the user some feedback as to why their data won't fit.

这篇关于TextArea中的大文本会冻结计算机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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