Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
256 views
in Technique[技术] by (71.8m points)

html - Force IE9 into browser compatibility view

I am aware of how to force IE into viewing a page in document compatibility, but what about browser compatibility view?

I have a project that only works when IE9 is in browser compatibility view for various reasons, yet I can't find any resources on how to force IE9 to do so.

Everyone only talks about forcing the document compatibility, e.g. using

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

But that doesn't work in my case, because it only sets the document view. Is there a way to set the browser view, too?

PS: To make it abundantly clear, this is the setting I need to enforce:

Browser Compatibility

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

See MSDN documentation.
You should use emulateIE7 since compatibility mode is kind of IE7:

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

Edit

If the above does not work, the other options are really poor.
Quoting from the link above:

  • Microsoft has not placed the domain name of the site on a blacklist. (blacklist linked in original article is very old and not being updated, you can find a local copy on your computer)
  • An intranet admin has not placed the site on a blacklist.
  • The user has not pressed the Compatibility View button (duh)
  • The site is not in the intranet zone
  • The page is not framed by a Compatibility Mode page.

The above are, AFAIK, the only causes for compatibility mode.
Unless you are prepared to contact Microsoft directly to have your website added to the global blacklist, there isn't much you can do (unless you want to wrap your site in a frame that originates from a blacklisted domain).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...