You can also force IE8 to use CV with this meta tag:
If you are having problems, I'd suggest first checking you have a legitimate doctype in your HTML (the simplest one is which forces standards mode). That will solve 90% of your problems, especially with IE6.
结论是:IE8兼容模式与独立的IE7是不同的,还是有些差异的,它并不是在IE8里简单包含了一个完整的IE7 。
四.具体差异的细节
1. Cross Document Communication
Hacks enabling cross-domain, cross-document communication have been disabled for security reasons.
解决方案:Use Cross Document Messaging (XDM) to work around this change.
2. Extending the Event Object
IE exposes new properties for certain AJAX features such as Cross Document Messaging (XDM), even in Compatibility View. Adding custom properties to the Event object can conflict with these new properties, such as "source".
event.source = myObject; // Read-only in IE8
解决方案: Change the names of conflicting custom properties to avoid collision.
event.mySource = myObject;
3. Attribute Ordering
The ordering of attributes has changed, affecting the attributes collection as well as the values of innerHTML and outerHTML. Pages depending on a specific attribute ordering may break.
attr = elm.attributes[1]; // May differ in IE8
解决方案: Reference attributes by name as opposed to their position within the attributes collection.
attr = elm.attributes["id"];
4. Setting Unsupported CSS Values
Assigning CSS values that were unsupported in IE7 but are supported in IE8 Standards Mode will not generate exceptions in IE8 Compatibility View. Some sites use these exceptions to determine if a particular value for a CSS property is supported or not.
复制代码
代码如下:
Try
{
elm.style.display = "table-cell";
} catch(e)
{
// This executes in IE7,
// but not IE8, regardless of mode
}
解决方案: Short of version detection, this is a difficult issue to work around. If this behavior is essential to a page, updating the page to run in IE8 Standards Mode may be the best approach.
【IE7 mode IE8兼容视图与独立IE7的区别是什么?】
推荐阅读
- 怎么完美解决IE8下不兼容rgba的问题?解决的方法分享
- win7怎么卸载ie10?WIN7卸载IE10恢复到IE8或者是IE9图文教程分享
- xp系统ie8浏览器经常崩溃或无响应怎么解决?解决xp下ie8崩溃或无响应的解决方法图文教程分享
- IE8浏览器点击后退没反应该怎样解决?解决的方法介绍
- Win7怎么卸载IE10浏览器?想恢复到IE8或者是IE9怎么办?
- xp系统ie8浏览器经常崩溃或无响应怎么办?xp下ie8崩溃或无响应的解决方法图文教程分
- IE8中禁止访问Https网站弹出窗口出现的妙招
- 使用IE8几个私密技巧
- 在IE8中享受IE9的隐藏搜索栏功能
- 从IE9回到IE8的技巧
