I have an application containing a webview. When the <!DOCTYPE html> not set on the HTML page, it causes unforeseen errors, because the fragments I execute are only compatible with HTML5 .
So, instead of writing <!DOCTYPE html> every time, can I just set the default quirk (quirk is the default HTML declaration that will be used if the HTML version of the page is not specified).
Therefore, if the declaration of the HTML page of the page is not specified, it will automatically be displayed in HTML5.
Any ideas on how to do this? Major browsers use this technique (including Chrome for Android) .
EDIT
I have over 500 such fragments using the built-in SVG , etc. -
<svg width="300" height="200"> <polygon points="100,10 40,198 190,78 10,78 160,198" style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" /> </svg>
These snippets do not work well on other versions of HTML. I have no problem writing <!DOCTYPE html> on every page, but I worry about my clients who can see, edit and modify my snippets or even create a new snippet .
I handed over my application to my friends for testing, and many of them complained that the fragments created by him did not work properly, and I think the same things could happen to my clients.
Please, help
source share