Detect Quirks vs Standards mode in IE 6, 7, Safari, Firefox, and Opera

Tagged with Javascript standards

Language: JavaScript

View as text

    <script type="text/javascript" charset="utf-8">
      if(document.compatMode == 'CSS1Compat'){
        alert("Standards mode");
      }else{
        alert("Quirks mode");
      }
    </script>
Last updated at 10:20 AM on Feb 02, 2009 by Brian Hogan

SnippetStash costs money to host and develop. The service is free for everyone to use
but if you found it useful please consider making a small donation.