Search code examples
twitter-bootstrapinternet-explorerxpages

XPages & IE Document Mode


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


Solution

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