【问题标题】:Difference between quirks mode and standards mode JavaScript怪癖模式和标准模式 JavaScript 的区别
【发布时间】:2012-07-09 18:56:47
【问题描述】:

这两种模式在IE 9中的JavaScript有什么不同吗?如果是,它们是什么?

【问题讨论】:

标签: javascript html internet-explorer internet-explorer-9 quirks-mode


【解决方案1】:
  1. IE9标准文档模式支持ECMAScript, Fifth Edition features,所以ArrayforEacheverymapdefinePropertyObjectdefinePropertykeys等方法都支持得很好. more about

  2. IE9 标准文档模式支持增强的 DOM 可编程性。 (可能不是您感兴趣的,但确实如此)。 more about

  3. IE9 删除了 IE8 JavaScript 实现和 ECMAScript, Third Edition Specification 之间的一些关键 differences

  4. Quirks 模式支持 IE6 的 JavaScript 功能,类似于 IE5 的行为以及 IE6、IE7 和 IE8 的 Quirks 模式行为。

  5. 在 IE9 标准模式中发生了一些变化,例如 does not support arguments.caller 不再,JavaScript Property Enumeration Differs 等等。阅读Features Changed in Windows Internet Explorer 9 的全部内容。

【讨论】:

    【解决方案2】:

    是的,有一些不同。

    例如,在 quirks 模式下,document.body(body-element)是根元素,而在标准模式下,它是 html-element(document.documentElement)。

    在尝试计算视口尺寸时,这可能会产生令人困惑的效果。

    【讨论】:

    • 这是 DOM 的区别,而不是 JavaScript。无论您使用什么脚本引擎,您都会观察到它。
    • 确实如此,但这肯定会影响 javascript dom 操作。如果可能的话,我想知道更多的区别
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-07
    • 1970-01-01
    • 2012-08-06
    • 2011-08-11
    • 2014-07-16
    相关资源
    最近更新 更多