为什么IE9在我的网站上切换到兼容模式? [英] Why does IE9 switch to compatibility mode on my website?

查看:206
本文介绍了为什么IE9在我的网站上切换到兼容模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了IE9测试版,并在我创建的特定网站(HTML5)IE9跳到兼容模式,除非我手动告诉它不。我已经尝试删除网站的几个部分,但没有改变。包括删除所有CSS包括。在我的其他网站上,它就很好。



此外,不要手动设置,因为IE9会记住用户设置,你不能把它还回自动(或至少我没有找到如何,甚至不通过私密浏览和清空缓存)



无论如何。跳转到兼容模式的网站: http://alliancesatwar.com/guide/

呈现正确的位置: http://geuze.name/basement/ (我无法发布超过1个超链接)



两者使用相同的 doctype 和所有。这些网站有很多共同点(除了外观)使用相同的基本模板(编码,元标记,doctype和相同的javascript)



这将是巨大的,如果有人有我的答案!

解决方案

在IE9文档模式中适用于我。 p>

没有一个 X-UA兼容头/元设置一个显式的documentMode,你会得到一个基于模式:

  • 也许这是否由于网站上的某些其他内容导致IE8 / 9的渲染器崩溃并回退到旧渲染器自动发生;

  • 用户是否选择将所有网站在兼容性视图中默认情况下;

  • IE是否认为网站在您的Intranet上,因此默认为兼容性视图;




  • 您可以从工具 - >兼容性视图设置中更改这些设置IE菜单。当然,这个菜单现在是隐藏的,所以你不会看到它,直到你按Alt。



    作为网站作者,如果你确信你的网站符合到标准(在其他浏览器中表现良好,并使用特征嗅探来决定使用哪种浏览器解决方法),我建议使用:

     < meta http-equiv =X-UA-Compatiblecontent =IE = Edge/> 

    或HTTP标头:

      X-UA-Compatible:IE = Edge 

    renderer无论使用什么IE版本。


    I have just installed IE9 beta and on a specific site I created (HTML5) IE9 jumps to compatibility mode unless I manually tell it not to. I have tried removing several parts of the website but no change. Including removing all CSS includes. On some other website of me it goes just fine.

    Also, don't set it manually because then IE9 remembers the user setting and you can't turn it back to automatic (or at least I haven't found how, not even via private browsing and emptying cache)

    Anyway. The site where it jumps to compatibility mode: http://alliancesatwar.com/guide/
    One where it renders correct: http://geuze.name/basement/ (I can't post more than 1 hyperlink)

    Both use the same doctype and all. Those sites have a lot in common(apart from appearance) using the same basic template(encoding, meta tags, doctype and the same javascript)

    It would be great if someone has an answer for me! An HTML5 website that renders in IE7-mode is pretty... lame.

    解决方案

    Works in IE9 documentMode for me.

    Without a X-UA-Compatible header/meta to set an explicit documentMode, you'll get a mode based on:

    • whether the user has clicked the ‘compatibility view’ button in that domain before;
    • perhaps also whether this has happened automatically due to some other content on the site causing IE8/9's renderer to crash and fall back to the old renderer;
    • whether the user has opted to put all sites in compatibility view by default;
    • whether IE thinks the site is on your intranet and so defaults to compatibility view;
    • whether the site in question is in Microsoft's own list of websites that require compatibility view.

    You can change these settings from ‘Tools -> Compatibility view settings’ from the IE menu. Of course that menu is now sneakily hidden, so you won't see it until you press Alt.

    As a site author, if you're confident that your site complies to standards (renders well in other browsers, and uses feature-sniffing to decide what browser workarounds to use), I suggest using:

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

    or the HTTP header:

    X-UA-Compatible: IE=Edge
    

    to get the latest renderer whatever IE version is in use.

    这篇关于为什么IE9在我的网站上切换到兼容模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆