No userData behavior when I have <!DOCTYPE html>?
-
26-06-2021 - |
Domanda
I wanted to use HTML5 localStorage in IE9 but it does not support local file system (or file://) So I fallback to use userData behavior. But I couldn't get it to work.
After all the testing, I figured out that if I remove the <!DOCTYPE html>
at the beginning of my html, everything works!
Can someone please tell me why?
and if <!DOCTYPE html>
is a must for HTML5 file?
Soluzione
HTML5 is not an official standard yet. If you set a doctype to a given standard, but use commands which are not part of that standard, or you use a doctype the the browser does not know, browser might not interpret these commands.
Maybe the W3C-validator http://validator.w3.org/ can help you
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow