Quirks

Quirks mode refers to a technique used by some web browsers for the sake of maintaining backwards compatibility with web pages designed for older browsers, instead of strictly complying with W3C and IETF standards in standards mode.

 

Sometimes you don't know wether a browser works improper because it may be in quirks-mode.

 

One possibility to question this is this peace of javascript:

<script type="text/javascript">
//<![CDATA[
  if (document.compatMode=='BackCompat') {
    document.write('Browser is in quirks-mode');
  } else {
    document.write('Browser is not in quirks-mode');
  }
//]]>
</script>

Using TYPO3 this happens easily by wrong order of DTD-declaration.

Solution:

page.config.doctypeSwitch = 1

 

 

IE8 has multiple backward-compatibility-modes, and the script for testing is more complex:

<script type="text/javascript">
//<![CDATA[
engine = null;
if (window.navigator.appName == "Microsoft Internet Explorer")
{
   // This is an IE browser. What mode is the engine in?
   if (document.documentMode) // IE8
      engine = document.documentMode;
   else // IE 5-7
   {
      engine = 5; // Assume quirks mode unless proven otherwise
      if (document.compatMode)
      {
         if (document.compatMode == "CSS1Compat")
            engine = 7; // standards mode
      }
   }
   // the engine variable now contains the document compatibility mode.
   document.write('<!--IE-Engine is '+engine+'-->');
}
//]]>
</script>
 
Ihre aktuelle Seitenauswahl:  
>>>