HTML 版本 4 与 5
有没有办法避免 HTML 5 解析器? 我的应用程序具有以下文档类型:
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"
我希望它用 HTML4 定义而不是 HTML5
解释 编辑:
我的问题原因是解决这个问题: Chrome 弹出窗口请填写此字段
Is there a way to avoid HTML 5 parser ?
My app has the following doctype:
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"
And I wish that it's interpreted with HTML4 definitions not HTML5
EDIT:
My question reason is to solve this:
Chrome popup Please Fill Out this Field
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
基于更新问题的新答案:
您遇到的问题不是 HTML 5 解析规则,而是对 HTML 5 属性的支持。不,你不能覆盖这个。如果您不想使用 HTML 5 中的新功能,请不要在文档中使用它们!
原答案:
不,没有。
HTML 5 解析规则主要是“浏览器在过去十五年里一直在做什么”。
这只是让我们摆脱完全有效的 SGML 功能但支持有限 在语言中(以及将它们传递为有效的验证器)。
New answer based on updated question:
It isn't the HTML 5 parsing rules you have a problem with, it is support for HTML 5 attributes. No, you can't override this. If you don't want to use things that are new in HTML 5 — don't use them in your document!
Original answer:
No, there isn't.
The HTML 5 parsing rules are mostly "What browsers have been doing for the last decade and a half anyway".
This just lets us get away from having perfectly valid SGML features with limited support in the language (and validators which pass them as valid).
您的问题与 HTML 4 和 HTML 5 (甚至与它们的解析器无关)无关。这与以下事实有关:您发明了自己的非标准属性(您一开始就不应该这样做),而现在新的标准化属性(或正在标准化过程中的属性)正在与它们发生冲突。
另请参阅我在您的其他问题中的回答。
You problem has nothing to do with HTML 4 and HTML 5 (and not even their parsers). It has to do with that fact, that you invented your own non-standard attributes (which you shouldn't have done in the first place), and now new standardized attributes (or attributes in the process of being standardized) are colliding with them.
See also my answer at the your other question.
谢谢大家,但特别感谢我的大学,他们知道如何解决我的问题:
http://www.w3.org/TR/html5/association-of-controls-and-forms.html#attr-fs-formnovalidate
您可以禁用验证在形式中。
Thank U All but specially thank to me college who knew how to solve my problem:
http://www.w3.org/TR/html5/association-of-controls-and-forms.html#attr-fs-formnovalidate
You can disable the validation in the form.