jquery - Jquery 在怪异模式下运行良好吗?

标签 jquery doctype

由于我无法控制的原因,该网站以怪异模式运行。在这种情况下 Jquery 会帮助我吗?

我希望 jquery 开发人员今天专注于严格模式 - future 的模式。另一方面,所有这些库都曾经开始减轻在怪异模式下工作的痛苦。

最佳答案

不!

根据official jQuery site v. 1.8.1 :

Don’t use Quirks mode! jQuery has never supported Quirks mode and we do not perform any testing in Quirks. This can affect values like $("window").height(), and the jQuery 1.8 Quirks mode results did change in order to support some modern browser features. The majority of problem cases we’ve seen are from developers that wanted to be in Standards mode but had an invalid doctype or extraneous markup before their tag. When in doubt, use the simple and short <!doctype html>.

关于jquery - Jquery 在怪异模式下运行良好吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1500353/

相关文章:

jquery - .trigger ("change") 无法在 .on ("change") 中工作

jQuery Ajax 调用 WebService 在 IE8 中返回 “No Transport” 错误 - 无跨域

javascript - 按下/按键后获取输入值

jquery - 即使我使用 &lt;!DOCTYPE>,如何设置 div 的高度(以 % 为单位)?

html - 为什么 Opera 将我的网页解析为 XML?

html - 迁移到新的虚拟主机时出现意外的空格和不正确的样式

html - 文档类型,HTML 5

javascript - 如何通过ID和值获取元素?

JavaScript <div> .class 提取

html - 在 HTML5 中拉伸(stretch) iframe