Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top