简体   繁体   中英

How reliable is Internet Explorers browser mode?

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?

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

      &lt;!--[if lte IE 9]> &lt;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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM