XPages & IE Document Mode

这一生的挚爱 提交于 2021-02-11 12:52:23

问题


I have a bootstrap enabled xpages application, which renders perfectly in chrome.

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....

It looks like it is trying to force IE7 document mode

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....

Thanks


回答1:


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>



回答2:


Your browser might be running in Enterprise mode:

https://docs.microsoft.com/en-us/internet-explorer/ie11-deploy-guide/fix-compat-issues-with-doc-modes-and-enterprise-mode-site-list

You might even want to consider the following answer before investigating any further with XPages: https://stackoverflow.com/a/26348511/3256564



来源:https://stackoverflow.com/questions/44523440/xpages-ie-document-mode

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