如何防止IE在兼容模式下打开我的页面? [英] How to prevent IE from opening my page in compatibility mode?

查看:135
本文介绍了如何防止IE在兼容模式下打开我的页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个html / jsp页面:

 <%@ page contentType =text / htmlpageEncoding = UTF-8\" %GT; 
<!DOCTYPE HTML>
< html ...
< / html>由于某种原因,它在默认情况下在IE兼容模式下打开(在我的情况下为版本10 ),这会混淆一切,因为它只是不理解图书馆中存在的一些现代构造如angularjs。
通过打开开发人员的工具并将视图模式更改为标准IE,一切都得到了修复,我的Web应用程序也能正常工作。

那么,这个标题有什么问题?有没有办法强制IE浏览器打开我的网页在正常模式?



这个问题或多或少是相同的,我知道:
为什么IE-8将视图推到Compact /兼容性视图?



但我不想强迫我的用户打开工具并设置选项,如正确标记的答案表明:其中大多数只是无知,其中许多人在其公司的PC上禁用了开发人员工具。
最后只是想看看我的web应用程序出现问题,并且让IE将它作为一个普通页面接受。

解决方案插入meta标签HTML:

 < meta http-equiv =X-UA兼容含量= IE =边沿/> 

边缘强制标准模式(或最新的渲染引擎)在IE中。



强制IE8转换为标准模式。

 < meta http-equiv =x -ua-compatiblecontent =IE = 8> 


I have this html/jsp page:

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html ...
</html>

which, for some reason, is opened by default in compatibility mode on IE (in my case version 10) and this messes up everything as it just does not understand some modern constructs present in libraries such as angularjs. By opening developer's tools and changing the view mode to "standard IE" everything fixes up and my web application works fine.

So, what's wrong with this header? Is there a way to force IE to open my page in normal mode?

This question is more or less the same of this one, I know that: Why Does IE-8 push the view to Compact/Compatibility view?

but I don't want to force my user to open tools and set options like correct marked answer suggests: most of them are just ignorant, many of them have developers tools disabled on their company's PC. In the end just want to see where's the problem with my web application and make so that IE accepts it as a normal page.

解决方案

insert meta tag in header HTML:

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

The "edge" forces standards mode (or latest rendering engine) in IE.

To force IE8 to standard mode.

<meta http-equiv="x-ua-compatible" content="IE=8">

这篇关于如何防止IE在兼容模式下打开我的页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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