IE8 之浏览器模型和文档对象模型(browser mode & document mode)

在IE8 RC1 的developer tools 有这么两个按钮 即 Browser Mode(浏览器模式)和Document Mode(Dom模型)文档对象模型
Browser Mode: IE7,IE8,IE8 Compat View
Document Mode: Quirks,IE7 Standards,IE8 Standards
围绕这BM&DM各自的三种模式 IE8 RC1 能通过9种组合方式渲染网页 个人对这种混乱无比反感,窃以为这是对号称牺牲自身利益以通过Acid测试 向标准靠拢的IE8是一种讽刺。
如何兼容这9种组合模式?(貌似实际模式只有6种 ,Quirks和Browser Mode基本无关)
Javascript 取得Document Mode:
engine = null;
if (window.navigator.appName == "Microsoft Internet Explorer") {
// 当前浏览器是IE,下面判断具体的显示模式
if (document.documentMode) // IE8
engine = document.documentMode;
else // IE 5-7
{
engine = 5; // quirks mode unless proven otherwise
alert("We can't support this mode or your IE is too old!");
window.location.href("http://www.microsoft.com/windows/products/winfamily/ie/default.mspx");
if (document.compatMode) {
if (document.compatMode == "CSS1Compat")
engine = 7; // standards mode
}
}
alert("IE的当前显示模式是" + engine);
}
而取得Browser Mode更简单了
<!--[if It 6]>
<script type="text/javascript">
alert("Quirks")
</script>
<![endif]-->
<!--[if IE 6]>
<script type="text/javascript">
alert("IE6")
</script>
<![endif]-->
<!--[if IE 7]>
<script type="text/javascript">
alert("IE7")
if (document.documentMode == 8){
document.createStyleSheet('Default/style/style.css');
}
</script>
<![endif]-->
<!--[if IE 8]>
<script type="text/javascript">
alert("IE8")
</script>
<![endif]-->
通过组合 便能取得IE8 当前组合模式 适当加载CSS 或拒绝对过低版本提供支持

tiffany
tiffany and co
tiffany sale
Tiffany Bangles
Tiffany Bracelets
Tiffany Earrings
tiffany co jewelry
gucci sale
gucci handbags
gucci jewelry
evening dresses
prom dresses
wedding dresses
discount wedding dresses
cheap wedding dresses
wedding dresses sale
wedding dresses
evening dresses
prom dresses
cheap evening dresses
cheap prom dresses
Gucci handbags
Gucci Classics
Gucci Cruise
Gucci Fall Winter
Gucci Watches
Gucci
Gucci jewelry
Gucci Jewelry
Gucci Wallets
links of london
links of london Jewellery