XPage &IE 文档模式 [英] XPages & IE Document Mode
问题描述
我有一个支持引导程序的 xpages 应用程序,它在 chrome 中完美呈现.
I have a bootstrap enabled xpages application, which renders perfectly in chrome.
同一个应用程序,在 IE11 中加载时,所有样式都不合适.但是,一旦我刷新页面,一切样式都正确,并且在会话期间保持如此.如果我关闭 IE,重新打开,加载页面,再次错误样式,刷新,再次更正会话......
The same application, that when loaded in IE11, all the styling is out of place. However, as soon as I refresh the page, everything styles correctly, and stays so for the duration of the session. If I close IE, re-open, load page, wrong style again, refresh, correct again for the session....
看起来它是在试图强制 IE7 文档模式
It looks like it is trying to force IE7 document mode
知道这是什么原因造成的吗?我在我的应用程序主题中使用了 <meta content="IE=edge" http-equiv="X-UA-Compatible">
,因此正确列出了 head 标签....
Any idea's what is causing this? I use <meta content="IE=edge" http-equiv="X-UA-Compatible">
in my application theme, so is correctly listed with the head tag....
谢谢
推荐答案
尝试在响应标头中设置 X-UA-Compatible - 例如,将以下内容添加到您的自定义控件中:
Try setting X-UA-Compatible in the response header instead - for instance by adding the following to your custom control:
<xp:this.beforeRenderResponse><![CDATA[#{javascript:
var response = facesContext.getExternalContext().getResponse();
response.setHeader("X-UA-Compatible", "IE=edge");
}]]></xp:this.beforeRenderResponse>
这篇关于XPage &IE 文档模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!