3

我们有一个传统的网站运行在我们对IE9所有客户的怪癖模式:IE9 - Quirks模式在主页和“Internet Explorer 9个的Standarts”在特定的iframe

enter image description here

此外,对于完整性的目的:

enter image description here

该网站是由许多的I帧,和新的需求出现了:
我需要创建一个新的iFrame,其中博otstap将被使用,并且我需要在Internet Explorer 9 Standarts(即,仅在此iframe中禁用怪癖模式并照常进行渲染)。

我试图把

<!DOCTYPE html> 

<meta http-equiv="X-UA-Compatible" content="IE=9"> 

的iframe里面,但没有奏效。

在这个问题上的任何帮助将非常appriciated。

回答

0

使用HTML5的doctype与链接到<iframe src="..."></iframe> URL中标记一个XML声明:

<?xml version="1.0" encoding="utf-8"?> 
<!DOCTYPE html> 
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml" xml:lang="en"> 
<!--...--> 
</html> 

因此,当XML内容的IFRAME内举办,树视图不会自动被生成默认。但是,当浏览器在兼容性视图中运行时,IE会尝试更加仔细地模拟以前版本的行为,这就是为什么在这些情况下树视图仍然显示的原因。

或XSLT:

<?xml version="1.0" encoding="utf-8"?> 
<?xml-stylesheet type="text/xsl" href="html5.xml"?> 
<xsl:stylesheet version="1.0" 
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
       xmlns="http://www.w3.org/1999/xhtml" 
       > 
<xsl:output method="xml" encoding="utf-8" version="" indent="yes" standalone="no" media-type="text/html" omit-xml-declaration="no" doctype-system="about:legacy-compat" /> 

<xsl:template match="xsl:stylesheet"> 
    <xsl:apply-templates/> 
</xsl:template> 

<xsl:template match="/"> 
    <html> 
    <head> 
     <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> 
    </head> 
    <body> 
     These<br/>words<br/>are<br/>seperated<br/>by<br/>BRs 
    </body> 
    </html> 
</xsl:template> 

</xsl:stylesheet> 

参考