How reliable is Internet Explorers browser mode?

依然范特西╮ 提交于 2019-12-24 16:08:57

问题


I can't seem to find any answers to this:

When i change the browser mode in IE, how much can I rely on it actually rendering the webpage as if it were lets say IE8 when I'm using IE10?


回答1:


I'm seeing mixed results so far; I never tested the IE9 version, so cannot comment if Microsoft have done better job this time round (the kinds of things reported at https://stackoverflow.com/a/11418046/841830 are much more specific to CSS than I've been looking at).

Specifically I've installed IE10 on Windows 7 (64-bit), and tested HTML5 features. The selection of Document Mode appears to be much more important than the selection of Browser Mode.

  • User agent changes correctly
  • The IE detection idiom works

     <!--[if lte IE 9]>
     <script language="javascript">
     var is_ie_9_or_earlier=true;
     &lt;</script>
     &lt;![endif]-->
    
  • typeof window.PostMessage: WRONG. this is being returned as "object" in IE7 mode. I believe it is undefined in real IE7. IE8/IE9/IE10 correctly return it as "object".

  • typeof new XMLHttpRequest().responseType. This is "undefined" in IE7/IE8/IE9, and "string" in IE10. Which I believe is correct.
  • typeof Object.keys. Undefined in IE7/IE8, but "function" in IE9/IE10. Again, I think this is correct.

On the other hand ietester on the same machine was much weirder (javascript not running correctly when it should have).



来源:https://stackoverflow.com/questions/14317360/how-reliable-is-internet-explorers-browser-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!