문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top