How to force IE10 to render page in IE9 document mode

前端 未结 9 731
北恋
北恋 2020-12-24 07:27

I have two questions:

  1. How can I force IE10 to render in IE9 document mode? Currently it\'s rendering my page in Standard document mode.

  2. In I

相关标签:
9条回答
  • 2020-12-24 07:39

    You should be able to do it using the X-UA meta tag:

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

    However, if you find yourself having to do this, you're probably doing something wrong and should take a look at what you're doing and see if you can do it a different/better way.

    0 讨论(0)
  • 2020-12-24 07:46

    You can tweak the Registry if you want to make changes only to your own system. If you have IE10 and lots of web sites you visit don't render properly in IE10, then you can tweak your registry to force IE to open in IE9 mode.

    HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
    

    Create a DWORD as iexplore.exe and give value 9999. Restart your IE and it will open in IE9 mode :)

    Thanks to my colleague Sreejith D :)

    0 讨论(0)
  • 2020-12-24 07:46

    I found this post while I was looking for a solution to my DNN6 website. The error was

    SCRIPT5007: Unable to get property 'documentElement' of undefined or null reference

    But I needed the same solution: force compability mode to IE9. So let me share with you what I did to solve this.

    So, for DotNetNuke 6 users try the StyleHelper SkinObject

    Worked great for me!

    0 讨论(0)
  • 2020-12-24 07:47

    By what this says, IE10 (the article is referred to a preview release, anyway) it's able to use X-UA-Compatible only if the document is in quirks mode (no DOCTYPE), otherwise IE10 won't react to the request.

    Here's an excerpt:

    Thus, to make IE10 react to the X-UA-Compatible directive, one must either create a page that triggers quirks-mode per the rules of HTML5 (that is: an a page with no doctype). One can also send the directive as a HTTP header, however: A HTTP sent directive appears to have no effect if you use it to downgrade the rendering — it can only be used to upgrade the rendering

    So, you've to do it manually with Dvelopers Tools, or with quirks mode (but I suggest to stay in IE10 mode which is for the first time aligned to the other browers' standard)

    EDIT: The follows are some useful link to read:

    http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx

    http://msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx

    http://blogs.msdn.com/b/ie/archive/2011/12/14/interoperable-html5-quirks-mode-in-ie10.aspx

    0 讨论(0)
  • 2020-12-24 07:56

    Do you mean you want to tell your copy of IE 10 to render the pages it views in IE 9 mode?

    Or do you mean you want your website to force IE 10 to render it in IE 9 mode?

    For the former:

    To force a webpage you are viewing in Internet Explorer 10 into a particular document compatibility mode, first open F12 Tools by pressing the F12 key. Then, on the Browser Mode menu, click Internet Explorer 10, and on the Document Mode menu, click Standards.

    http://msdn.microsoft.com/en-gb/library/ie/hh920756(v=vs.85).aspx

    For the latter, the other answers are correct, but I wouldn't advise doing that. IE 10 is more standards-compliant (i.e. more similar to other browsers) than IE 9.

    0 讨论(0)
  • 2020-12-24 07:56

    The hack is recursive. It is like IE itself uses the component that is used by many other processes which want "web component". Hence in registry we add IEXPLORE.exe. In effect it is a recursive hack.

    0 讨论(0)
提交回复
热议问题