html 的输入字段中可能有多少个字符? [英] how many characters are possible in an input field in html?

查看:27
本文介绍了html 的输入字段中可能有多少个字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

html 输入字段中允许的自然"字符数是多少?

What is the "natural" number of allowed characters in an input field in html?

非常感谢

评论补充

我不需要通过 post 或 get 将它发送到服务器.我将通过 JS 解析字符串.

i don't need to send it to the server via post or get. i am going to parse the string via JS.

因此,如果输入是无限的,就像@sAc 所说的那样,会给我带来另外两个问题:

So if the input is unlimited like @sAc says brings me to two further questions:

  1. JS可以最长的String是多少处理?
  2. 允许的最低数量是多少共同输入的字符浏览器?(这将是我的限制比)

推荐答案

我的 32 位 Win 7 机器上的 Firefox 3.6.6 在 1,000,000 个字符后变慢,在 4,000,000 个字符后完全冻结.

Firefox 3.6.6 on my 32 bit Win 7 machine becomes slow after 1,000,000 characters and totally freezes after 4,000,000.

Chrome 在 8,000,000 之后的某个地方崩溃了.

Chrome crashes somewhere after 8,000,000.

IE8 在 8,000,000 之后的某个地方崩溃了.

IE8 crashes somewhere after 8,000,000.

Safari 在 2,000,000 后崩溃.

Safari crashes somewhere after 2,000,000.

在我的测试中,Chrome/IE8/Safari 不会像 Firefox 那样随着大小的增加而变慢.

In my testing Chrome/IE8/Safari don't slow down as the size goes up the way Firefox does.

这篇关于html 的输入字段中可能有多少个字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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