Some important improvements in the new version:
All these new features along with the entire list of bug fixes are detailed in the official blog post.
Unfortunately, this contains some breaking changes, and the team has highlighted them with a separate chapter in the official update:
变更 | JQuery 1.5.2 示例 | JQuery 1.6 示例 |
data()方法使用破折号创建驼峰格式。 |
data-max-value="15" 创建{ max-value: 15 } | data-max-value="15" 创建{ maxValue: 15 } |
区分了Property与Attribute。attr()方法现在不能用于获取preperty的值。为了处理property的值,引入了prop()和removeProp()方法。 | 如果复选框被选中,checkbox.attr("checked")返回(true) |
checkbox.attr("checked")返回空字符串。 要判别是否选中,需在事件处理程序中使用 $(this).prop("checked")或 $(this).is(":checked")。 |
If nothing else, the second change will affect existing projects that plan to upgrade to 1.6.
This version was launched 3 months after the release of 1.5 and 1 month after the release of 1.5.2. Work on 1.7 has already begun, and the JQuery team has accepted the feature proposal.
JQuery is a JavaScript library for rapid web development that simplifies HTML document traversal, event handling, animation, and Ajax interaction.