0

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

enter image description here

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

Chris Richards
  • 695
  • 5
  • 14

2 Answers2

2

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>
Per Henrik Lausten
  • 21,331
  • 3
  • 29
  • 76
  • Hi Per, thanks, this has worked a treat! Question though.... How does this differ to me putting similar code into my theme file? Thanks again – Chris Richards Jun 14 '17 at 09:08
  • 1
    My guess: the code in the theme sets the meta tag in the HTML document which is too late because at that point IE has already decided to run in compatibility mode. When setting X-UA-Compatible in the response header IE reads it before parsing the HTML. – Per Henrik Lausten Jun 14 '17 at 09:15
  • Sounds legit! Cheers – Chris Richards Jun 14 '17 at 10:41
1

Your browser might be running in Enterprise mode:

https://learn.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

shillem
  • 1,260
  • 7
  • 12
  • Hi Shillem, Per's answer has worked for me, but I think I'll still have a read through the post you've linked to as I've glanced at it, and looks like there's some good info there. Thanks – Chris Richards Jun 14 '17 at 09:10