0

I developed XPages application. When loading the page on IE, the outputed html tag is the following.

When loading the page with FQDN or IP Address of the host part,

<HTML lang=en>

When loading the page with the host name(this is defined in hosts file) of the host part,

<html class=" lotusui_ie lotusui_ie7" lang="en">

As a result, the layout is broken in the latter case. I'd like to expect the former tag is outputed in any cases.

Then, I used http-equiv="X-UA-Compatible" but does not work. What causes this issue?

yukinko
  • 85
  • 6
  • 1
    IE could emulate for IE7 when displaying pages from local domain. Add to render it without emulation. You can also use F12 (developer tools) to set current document mode. See this answer: https://stackoverflow.com/a/44529397/1181067 – Ferry Kranenburg Dec 22 '19 at 14:45
  • As I wrote, I used "X-UA-Compatible". Then the mode is changed but the html tag is still different as I wrote the above. – yukinko Dec 22 '19 at 15:04
  • You mean, Xpages theming is just adding some style classes to the html tag? I do not understand the problem then? – Ferry Kranenburg Dec 23 '19 at 13:21
  • I tested a simple XPages which just show 'test' string. The IE mode is changed by X-UA-Compatible but the html tag contains class=" lotusui_ie lotusui_ie7". As a result, the layout is not rendered as I expect. Then if I remove the class by F12 dev tool, the layout is my expectation. Am I misunderstanding something? – yukinko Dec 23 '19 at 15:30
  • 1
    Yes, the "lotusui_ie lotusui_ie7" classes are set by the theming code (Dojo). This is probably because IE is rendering in compatibility mode. Check this out: https://www.ibm.com/support/pages/internet-explorer-compatibility-view-mode-causes-lmi-issues-qradar-network-security-sensors – Ferry Kranenburg Dec 23 '19 at 21:15
  • Thanks, I understand I need to remove the class after the pageload – yukinko Dec 23 '19 at 23:15

1 Answers1

0

How we set X-UA-Compatible:

<xp:this.beforeRenderResponse><![CDATA[#{javascript:
try {
    var response = facesContext.getExternalContext().getResponse();
    response.setHeader("X-UA-Compatible", "IE=10");
} catch (e) {
  dprint("IE emulation: " + e);
}}]]></xp:this.beforeRenderResponse>
D.Bugger
  • 2,300
  • 15
  • 19
  • Thanks but I used the same code. This code works for IE document mode, however the outputted HTML tag of XPage is As a result, I can't get the layout I set by "X-UA-Compatible". – yukinko Dec 23 '19 at 11:51
  • 1
    https://xomino.com/2015/09/30/oneui-ie7-seriously-another-one-of-those-days/#comments – D.Bugger Dec 23 '19 at 17:45
  • 1
    document.querySelector("html").classList.remove("lotusui_ie7") – D.Bugger Dec 23 '19 at 17:50
  • Thanks for useful information! I need to remove both classes. Removing only "lotusui_ie7" does not solve the layout issue. – yukinko Dec 23 '19 at 23:08
  • 1
    document.querySelector("html").classList.remove("lotusui_ie", "lotusui_ie7") – D.Bugger Dec 24 '19 at 14:18