日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

IE7 mode IE8兼容視圖與獨(dú)立IE7的區(qū)別詳解( 三 )


meta http-equiv=X-UA-Compatible content=IE=EmulateIE7 /
If you are having problems, I’d suggest first checking you have a legitimate doctype in your HTML (the simplest one is !DOCTYPE html which forces standards mode). That will solve 90% of your problems, especially with IE6.
結(jié)論是:IE8兼容模式與獨(dú)立的IE7是不同的,還是有些差異的,它并不是在IE8里簡(jiǎn)單包含了一個(gè)完整的IE7 。
四.具體差異的細(xì)節(jié)
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.

復(fù)制代碼代碼如下:
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.

推薦閱讀