我应该使用哪种MIME类型将XHTML5提供给IE7和IE8? [英] Which MIME type should I use to serve XHTML5 to IE7 and IE8?

查看:123
本文介绍了我应该使用哪种MIME类型将XHTML5提供给IE7和IE8?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用XHTML5,但显然他们两个浏览器不接受 application / xhtml + xml MIME类型。我读过他们会接受 text / xml (或者 application / xml 不确定)但是它有点像hackish。所以我想知道我是否应该只将HTML5用于IE7和IE8?

I want to use XHTML5 but apparently they two browsers don't accept the application/xhtml+xml MIME type. I read that they will accept text/xml (or application/xml not sure) but it is kind of hackish. So I was wondering if I should just serve HTML5 to IE7 and IE8?

请不要继续谈论XHTML与HTML的优势。我知道。

Please don't go on talking about XHTML vs HTML advantages. I know.

推荐答案

XHTML 5不是标准。 XHTML 2确实规定了一种新的doctype,但XHTML 2并不受任何现代浏览器的支持(因为它基本上没有完成)。

XHTML 5 is not a standard. XHTML 2 does prescribe a new doctype, though XHTML 2 is not supported by any modern browsers (as it is largely unfinished).

HTML5Doctor建议如果定位XHTML5方法,只需使用HTML5 doctype,这是有道理的。 HTML5 doctype与IE7 / 8兼容。

HTML5Doctor recommends that if targeting an "XHTML5" approach, simply use the HTML5 doctype, which makes sense. The HTML5 doctype is compatible with IE7/8.

http://html5doctor.com/html-5-xml-xhtml-5/

请记住,要使用HTML5(正确使用) )在IE< 9中,你需要包含HTML 5 shiv。

Remember, to use HTML5 (properly) in IE <9, you need to include the HTML 5 shiv.

http://ejohn.org/blog/html5-shiv/

此外,就MIME类型而言XHTML5,您必须使用 application / xhtml + xml application / xml 提供内容,旧版本的IE将会不支持。因此,如果您尝试采用纯粹方法,则无法获得IE 6/7支持。

Also, in terms of a MIME type for XHTML5, you MUST serve the content with application/xhtml+xml or application/xml, which older version of IE will NOT support. Thus, if you're trying to take a purist approach, you CANNOT have IE 6/7 support.

这篇关于我应该使用哪种MIME类型将XHTML5提供给IE7和IE8?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆