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

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

问题描述



非常感谢



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

除了注释以外

我不需要通过发布或获取将其发送到服务器。
i会通过JS解析字符串。

所以如果输入是无限的,就像@sAc所说的带来了另外两个问题:


  1. 什么是最长的String JS can
    处理?

  2. 允许的$ b的最小数量是多少$ b字符为常见的
    浏览器输入(这将是我的限制
    比)


解决方案

在我的32位Win 7计算机上,Firefox 3.6.6在1,000,000个字符后变得缓慢,并在4,000,000后完全冻结。

8,000,000美元。



IE8在8,000,000后崩溃。

Safari在2,000,000后崩溃。


$ b

在我测试Chrome / IE8 / Safari时,速度不会像Firefox一样大小。


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

thanks a lot

addition due to the comments

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

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

  1. What is the longest String JS can handle?
  2. what is the lowest amount of allowed characters for an input in common browsers?(which would be my limit than)

解决方案

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 crashes somewhere after 8,000,000.

IE8 crashes somewhere after 8,000,000.

Safari crashes somewhere after 2,000,000.

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

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

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