HTML Version 4 vs 5

穿精又带淫゛_ 提交于 2019-12-13 04:43:16

问题


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


回答1:


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).




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/5637408/html-version-4-vs-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!