[2014-04-16]
Making Drupal compatible with Internet Explorer's Compatibility Mode
'html_tag',
'#tag' => 'meta',
'#attributes' => array(
'http-equiv' => 'X-UA-Compatible',
'content' => 'IE=edge,chrome=1',
),
'#weight' => -99999,
);
// Add header meta tag for IE to head
drupal_add_html_head($meta_ie_edge, 'meta_ie_edge');
}
This snippet provides two methods for getting Internet Explorer to break out of compatibility mode. The first is actually part of Drupal 8 (https://drupal.org/node/1203112) and the second adds the proper meta tag. It also ensures that the X-UA-Compatible meta tag is first. There are instances where Interner Explorer doesn't respect the tag when it is the second or later meta tag.
📘 Understanding Drupal: A Complete Guide to Caching Layers — my new book is out now!
Want more? Sign up for my weekly newsletter