解决ie下访问不正常的问题

上周五我提交了代码,但是在经理的浏览器上用不了,我用的是IE8,经理的是IE10。但是星期六就要到上海去测试代码了,

经理上网查资料,很暴力的把浏览器设置为IE8,如: <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />

后来我也浏览关于兼容的问题,有些系统就是不支持IE的新版本,所以有时候只可以强制转化了(现在的安装系统最低版本貌似是IE8),

下面是我找的资料和连接:

资料一:

x-ua-compatible 用来指定IE浏览器解析编译页面的model

x-ua-compatible 头标签大小写不敏感,必须用在 head 中,必须在除 title 外的其他 meta 之前使用。
1、使用一行代码来指定浏览器使用特定的文档模式。
<meta http-equiv="x-ua-compatible" content="IE=9" >
<meta http-equiv="x-ua-compatible" content="IE=8" >
<meta http-equiv="x-ua-compatible" content="IE=7" >
 
2、在一些情况下,我们需要限定浏览器对文档的解析到某一特定版本,或者将浏览器限定到一些旧版本的表现中。可以用如下的方式:
<meta http-equiv="x-ua-compatible" content="IE=EmulateIE9" >
<meta http-equiv="x-ua-compatible" content="IE=EmulateIE8" >
<meta http-equiv="x-ua-compatible" content="IE=EmulateIE7" >
 
使用这种写法,浏览器或者使用标准模式进行解析,或者使用 IE5 Quirks 模式进行解析。
 
3、为了测试,我们也可以使用下面的语句指定浏览器按照最高的标准模式解析页面。
<meta http-equiv="x-ua-compatible" content="IE=edge" >
 
4、多个模式的指定。我们可以用逗号分割多个版本,这种情况下,浏览器会从这个列表中选择一个他所支持的最高版本来使用标准模式进行渲染。如下面的例子,在IE8进行浏览时,将会使用IE7的标准模式进行渲染,因为他本身不支持IE9和IE10。
<meta http-equiv="x-ua-compatible" content="IE=7,9,10" >

资料二:

Document modes and compatibility with Internet Explorer 11

30 out of 76 rated this helpful - Rate this topic

The compatibility improvements made in Internet Explorer 11 lets older websites just work in the latest standards mode, by default, without requiring emulation of the previous browser behavior. Because older websites are now just working, we’ve decided that Internet Explorer 10 document mode will be the last new document mode. Instead, developers will need to move to using Edge mode in Internet Explorer 11.

If you decide that you still need to emulate a previous browser environment, Internet Explorer 10 or older, you can change your server configuration to add X-UA-Compatible meta tags into the HTTP header. Changing this content value lets your site show up as it would appear in the selected version of Internet Explorer. For example, if you wanted the content to look like it did in Internet Explorer 10, you'd specify the value of IE=10 in the X-UA-Compatible metadata. All of the other supported values are here:

 

Content valueMeaning

IE=5

Renders using Internet Explorer 5 Quirks mode.

IE=7

Renders using Internet Explorer 7 standards mode.

IE=8

Renders using Internet Explorer 8 standards mode.

IE=9

Renders using Internet Explorer 9 standards mode.

IE=10

Renders using Internet Explorer 10 standards mode.

IE=Edge

Renders using the latest mode. This mode is the recommended for all websites.

ImportantImportant
Using document modes doesn’t alleviate the need for testing content. For further information about compatibility and the X-UA-Compatible header, see Defining Document Compatibility.Don’t target future content values, such as IE=11 and higher. Instead, use IE=Edge to get the latest mode.

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

http://msdn.microsoft.com/en-us/library/dn321432.aspx
http://blog.csdn.net/bugknightyyp/article/details/8880505

http://blog.csdn.net/yhawaii/article/details/6915036

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值