How can I make IE recognize HTML 5 tags?

情到浓时终转凉″ 提交于 2020-01-25 04:57:08

问题


What are some good solutions for making my HTML 5 pages compatible with IE (at least IE 7 & 8)?

Is there an industry standard that I can use that will make IE recognize things like <article> and <nav>?


回答1:


Yeah, you can run the html5shiv if you want, which is what you seem to be referring to. It'll allow IE to parse the tags initially. But that will still leave you with the same problems if you want to use innerHTML (or framework code based on it). There's the innershiv, but it's not wonderfully efficient and it won't work for all top-level elements.

What do you want to achieve by using the semantic-but-behaviour-free elements like <article>? You will be taking on extra browser problems for little practical benefit. To be honest, I really wouldn't bother, today. It's something for the future.




回答2:


It's very simple: Just use document.createElement('whatever')

http://remysharp.com/2009/01/07/html5-enabling-script/



来源:https://stackoverflow.com/questions/3621435/how-can-i-make-ie-recognize-html-5-tags

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!