title: Detect IE8 Compatibility Mode
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/10213639/differentiate-ie7-browser-and-browser-in-ie7-compatibility-mode">Differentiate IE7 browser and browser in IE7 compatibility mode</a>  </p>
  </blockquote>
  
  
  
  <p>We have not had time to fully test IE8 with our fairly extensive system.  We are also reaching the point at which we can't prohibit the use of IE8.  Our users are stubborn and not terribly sophisticated, so we don't feel that we can tell them to use the "Compatibility Mode" button.  Instead, we will add the "IE=EmulateIE7" meta tag as a <em>temporary</em> fix.</p>
  
  <p>The problem is that when this tag is used, the browser still reports itself to be IE8, which is then detected by our pages and rejected.  I can understand why server-side detection can't pick up the meta tag (the server already has the user-agent before the meta tag is sent and processed), but client-side checks also fail.  If the compatibility mode button is clicked on the client machines, the user-agent is IE7, but not if we use the meta tag.  </p>
  
  <p>This means, among other things, that we have to disable the checking and then, if we make a mistake somewhere and forget to add the meta tag to a page, we will have broken pages.</p>
  
  <p>Has anyone else encountered this and come up with a better approach?  Is there no way to detect that IE8 is running in compatibility mode when the mode is set by the meta tag?</p>
  
  <p>And, we do know that there is a valid school of thought that we should just make all the pages compatible with IE8 Standards mode but in our little corner of reality, that is not a feasible option right now (and I'll point out that we didn't create 4 or 5 versions of IE that had to be written for in a non-standard way).</p>