0

I'm using the following conditional comment to notify users thet they are running a non-supported browser version.

<!--[if lt IE 8]>
...
<![endif]-->

I noticed that this comment is being triggered on IE9 Compatibility mode as-well what was not my attention.

Is there a way to make IE9 Compatibility mode an exception or to distinguish it and IE7 mode from regular IE7 so that I can customize the message for them?

Hugo
  • 12,334
  • 6
  • 30
  • 36
  • Is it still triggered when you set the headers provided in this answer : http://stackoverflow.com/questions/10305631/ie9-float-with-overflowhidden-and-table-width-100-not-displaying-properly ? – Denys Séguret May 14 '12 at 08:25
  • 1
    BTW, it's generally better to explicitly test in js for the ability of a specific feature than testing for a browser/version. – Denys Séguret May 14 '12 at 08:26
  • meta tag `` does not change the behavior – Hugo May 16 '12 at 06:47

1 Answers1

0

One easy way to check compatibility mode is:

try{ JSON } catch (e){ alert("Compatibility Mode Detected")  }

This works because the JSON object is unavailable while in compatibility mode.

Brian McGinity
  • 5,777
  • 5
  • 36
  • 46
  • This is no longer true - at least with IE 11. `JSON` does exist with IE11 in compatibility mode. – Joe B Apr 26 '17 at 20:14