I have a app containing a WebView. When <!DOCTYPE html>
is not defined in a HTML page, it produces unexpected errors as snippets which I run are only compatible with HTML5.
So instead of writing <!DOCTYPE html>
everytime, can I simply set default quirk (quirk is a default HTML declaration which will be used if HTML version of a page is not specified).
So if page's HTML declaration is not specified, it will automatically render in HTML5.
Any ideas on how to do this? Major browsers use this technique (Including Chrome for Android).
EDIT
I have 500+ snippets like this using directly embedded 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 don't run well on other versions of HTML. I don't actually have any problem in writing <!DOCTYPE html>
on every page but I am worried about my clients who can see, edit and modify my snippets or even create a new snippet.
I gave my app to my friends for testing and many of them complained the snippets that they created don't run properly and I think same sort of thing can happen with my clients as well.
Please help
<DOCTYLE ...>
, the page will automatically render in the latest available HTML version? This is what I want. I want to set a default<DOCTYPE ...>
thing that will be used if I didn't specify which HTML version in any of my HTML files. – Marivaux