When X-UA-Compatible Doesn’t Work

The ie=edge tag would force ie to render the page in the highest mode available.

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

However , it might not work if:

Placing the Meta Tag Too Late: If the meta tag appears after we have had to determine the rendering engine, then you are too late. You have to include that metadata before running scripts or rendering HTML. The mode can be switched only before you’ve done any work which uses a rendering and scripting engine, otherwise we decide based on the header or the group policy.

&amp;lt;!-- This is too late –-&amp;gt; 
&amp;lt;script src=&amp;quot;script.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;
&amp;lt;meta http-equiv=&amp;quot;X-UA-Compatible&amp;quot; content=&amp;quot;IE=8&amp;quot; &amp;gt;
&amp;lt;!-- This is good –-&amp;gt;
&amp;lt;meta http-equiv=&amp;quot;X-UA-Compatible&amp;quot; content=&amp;quot;IE=8&amp;quot; &amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;script.js&amp;quot;&amp;gt;

I found this flowchart over here that provides an explanation of how IE9 determines document mode:



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s