Force IE8 Into IE7 Compatiblity Mode

2019-01-04 23:29发布

Is there a way to force IE8 into IE7 compatibility mode using .NET or Javascript?

9条回答
来,给爷笑一个
2楼-- · 2019-01-05 00:10

its even simpler than that. Using HTML you can just add this metatag to your page (first thing on the page):

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

If you wanted to do it using.net, you just have to send your http request with that meta information in the header. This would require a page refresh to work though.

Also, you can look at a similar question here: Compatibility Mode in IE8 using VBScript

查看更多
来,给爷笑一个
3楼-- · 2019-01-05 00:12

one more if you want to switch IE 8 page render in IE 8 standard mode

<meta http-equiv="X-UA-Compatible" content="IE=100" /> <!-- IE8 mode -->
查看更多
甜甜的少女心
4楼-- · 2019-01-05 00:14

my code has this tag

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

is there a way where i can skip this tag and yet layouts get displayed well and fine using that tag the display will work upto IE 7 but i want to run it wel in further versions...

查看更多
可以哭但决不认输i
5楼-- · 2019-01-05 00:15

There is an HTTP header you can set that will force IE8 to use IE7-compatibility mode.

查看更多
对你真心纯属浪费
6楼-- · 2019-01-05 00:17

You can do it in the web.config

    <httpProtocol>
        <customHeaders>
            <add name="X-UA-Compatible" value="IE=7"/>
        </customHeaders>
    </httpProtocol>

I have better results with this over the above solutions. Not sure why this wasn't given as a solution. :)

查看更多
贪生不怕死
7楼-- · 2019-01-05 00:20

This can be done in IIS: http://weblogs.asp.net/joelvarty/archive/2009/03/23/force-ie7-compatibility-mode-in-ie8-with-iis-settings.aspx

Read the comments as well: Wednesday, April 01, 2009 8:57 AM by John Moore

A quick follow-up. This worked great for my site as long as I use the IE=EmulateIE7 value. Trying to use the IE=7 resulted in my site essentially hanging when run on IE8.

查看更多
登录 后发表回答