1

In ie9 browser instead of the document mode Edge, it is getting changed to document mode ie8.

I know this is because of the Enterpise mode switched on. There any way to override to the Edge mode.

Because of this wrong rendering mode, some alignment issues are occurring, which I have to fix it.

In order to fix that, I need to detect If the rendered profile is Enterprise mode and Document type id ie8

< meta http-equiv="X-UA-Compatible" content="IE=Edge" />

In all other browsers there is no issue.

Ocracoke
  • 1,718
  • 3
  • 24
  • 38
PCA
  • 1,677
  • 6
  • 28
  • 45
  • This isn't for the same IE version but I think this answer from another similar question would apply. http://stackoverflow.com/a/28821906/1132499 Also, should there be a double quote at the end of `IE=Edge`? – Ocracoke Sep 08 '15 at 11:59
  • oh double quote is copying mistake. – PCA Sep 08 '15 at 12:05

1 Answers1

0

You can try to use navigator.userAgent property with function like this:

function getIEVersion() { if (~navigator.userAgent.search(/MSIE (\d)/g)) { return +navigator.userAgent.match(/MSIE (\d+)/)[1]; } else { return; } }.

NB! In IE11 you will get undefined (because it has another UserAgent, but IE11 is not your case).

For checking compatible mode you can try this:

function isIEInCompatibleMode() { return !!~navigator.userAgent.search(/compatible/g); }

Salasar
  • 136
  • 10