Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent IE9 from rendering intranet sites in compatibility mode

IE9 has a weird problem where it renders intranet sites in compatibility mode.

Does anyone know a way how to prevent this from happening?

Note: I am not looking for a way to prevent it on a single users machine, but some programmatic way to prevent the site from ever rendering in compatibility mode.

like image 583
novicePrgrmr Avatar asked Oct 15 '12 10:10

novicePrgrmr


People also ask

How do I disable intranet sites in Compatibility View?

Click Tools in the browser menu bar, and then click Compatibility View settings. Clear the Display intranet sites in Compatibility View check box, and the click Close.

Is running in Compatibility View because Display intranet sites?

The option Display intranet websites in Compatibility View uses the following algorithm in order to determine whether Compatibility View should be used: Check if the page belongs to the local Intranet Security zone. Check if the page would belong to the local Intranet zone, when ignoring the explicit Zone-mappings.

How do I display intranet sites in Compatibility View in Edge?

Use Compatibility View Settings in Edge: Use Always You'll see the Default browser option on the left-side navigation pane. Click on it. Now, go to the Internet Explorer mode pages. Select the Add button and then write down the website addresses you want to open in the compatibility view.


1 Answers

After an exhaustive search, I found out how to successfully prevent an intranet site from rendering in compatibility mode in IE9 on this blog:

From Tesmond's blog

There are 2 quirks in IE9 that can cause compatibility mode to remain in effect. The X-UA-Compatible meta element must be the first meta element in the head section. You cannot have condtional IE statements before the X-UA-Compatible meta element. This means that if you use Paul Irish's wonderful HTML5 Boilerplate then on an Intranet with default IE9 settings your website will display in compatibility mode. You need to change the start of the boilerplate from the following:-

<!doctype html> <!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]--> <!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]--> <!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 

to:

<!doctype html> <html class="no-js" lang="en"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta charset="utf-8"> 
like image 92
novicePrgrmr Avatar answered Sep 26 '22 00:09

novicePrgrmr