HTML 标签名称是否有最大尺寸(长度) [英] Does HTML tag name has a max size ( length )

查看:39
本文介绍了HTML 标签名称是否有最大尺寸(长度)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确实想为 HTML 标记名构建一个验证器,

i do want to build a validator for HTML tagname ,

   vdAPI.get({module:'html',subject:'tag'}).validator=function (tag){
         return !vdAPI.nottags.contains(tag) && (tag.length>0 && tag.length <= vdAPI.MAX_LENGTH_TAG)
    }

vdAPI.MAX_LENGTH_TAG 的合适值是多少?

推荐答案

来自 w3.组织:

下面描述的算法对生成的 DOM 树的深度或标签名称的长度、属性名称、属性值、文本节点、没有限制、等等.虽然鼓励实现者避免任意限制,但认识到实际问题可能会迫使用户代理施加嵌套深度限制.

The algorithm described below places no limit on the depth of the DOM tree generated, or on the length of tag names, attribute names, attribute values, Text nodes, etc. While implementors are encouraged to avoid arbitrary limits, it is recognized that practical concerns will likely force user agents to impose nesting depth constraints.

这篇关于HTML 标签名称是否有最大尺寸(长度)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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