I have a web application which is developed using angular js. We also have another legacy web app which is included in iframe in one of our pages. This legacy web app works only in quirks mode. We need to make this work in our firm's browser based application which runs in browser mode=IE9 and has css & js engine of IE8, i.e doc mode=IE8.

Now my requirement is to launch first page of our browser in IE8 doc mode, second in quirks mode and third again in IE8 doc mode. But i find that once i change browser mode, its stick for entire web app even second page loaded has different configuration. Is it possible in some way to change browser mode page wise? enter image description here

有帮助吗?

解决方案

It's best to set your doctype to the max

<!DOCTYPE html>

And use the meta tag to change certain pages.

The meta tag is placed in the head tag and tells your browser how to behave.

For IE 8

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

For Quirk mode never tried it myself, so I'm not sure how it will work

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

Setting it to 5 supposedly tells the browser to work in quirks mode.

其他提示

Sadly this is a common scenario. I am not quite sure how the iFrame thing truly affects legacy LOB web applications, but I think the DOCUMENT mode trickles down.

Why don't you investigate the new Enterprise Mode and see if that helps you out:

http://love2dev.com/#!article/The-New-Internet-Explorer-Enterprise-Mode-or-Why-You-Should-Never-Use-IE-8-Anymore http://love2dev.com/#!article/Internet-Explorer-Enterprise-Mode-Resources

Also I would encourage you to use the X-UA-Compatible META tag or HTTP Header to tell IE what engine to use. I think enterprise mode will work for most things, so try that first because it will free your organization to upgrade to the latest without breaking legacy applications.

And of course by all means please pursue a path where you upgrade those legacy applications to modern standards. This is just a sound business practice because it will eliminate issues like you are having and give the application a longer life.

You can achieve this using different tags in web.config and in required pages.

We have an application which uses classic asp, ASP.Net and ASP.NET MVC

Common compatibility mode is set in web.config as below:

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

for MVC, we have used common tag in _Layout.cshtml as below. Which takes care of AngularJS, Metro Bootstrap etc.

<meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1" />
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top