Reputation: 5827
I want only IE8 to work with compatibility mode. But I couldn't do it by using the first way below:
First way: (It doesn't work)
<!--[if IE 8]>
<com:TMetaTag HttpEquiv="X-UA-Compatible" Content="IE=EmulateIE7" />
<![endif]-->
Second way:
<script type="text/javascript">
var $j = jQuery.noConflict();
if($j.browser.msie && $j.browser.version == "8.0")
{
alert("<com:TMetaTag HttpEquiv=\"X-UA-Compatible\" Content=\"IE=EmulateIE7\" /> ");
}
</script>
Now I am trying to echo the meta tag by using jquery like above. But I don't know how to do that? So I alert it to show you the problem clearly.
Note: I am using a php framework named by prado. So the tag element is a little bit different like (<com:TMetaTag...
)
Upvotes: 2
Views: 287
Reputation: 819
Using Javascript, you would use the
document.write()
Method to write directly into the HTML.
Edit: Didn't see you were using JQuery. This is probably a safer way of doing things:
$("head").append('<com:TMetaTag HttpEquiv="X-UA-Compatible" Content="IE=EmulateIE7" />')
Upvotes: 1
Reputation: 67892
IE8 in compatibility mode is going to recognize as IE7.
Try
<!--[if lte IE 8]>
Upvotes: 2