Some important improvements in the new version:
- The attr (), val (), and data () methods provide better performance;
- The attr () method supports the Boolean attribute;
- Added a hook function that allows extension of the attr () and val () methods;
- The map () method adds support for objects (ing JavaScript Object Attributes to functions)
- You can use relative values ("+ =", "-=") to update CSS;
- The deferred. always () and deferred. pipe () methods are added to reduce the amount of code and improve the ease of coding;
- Synchronous animation-now all animations are synchronized to the same time interval. The new browser function makes the animation smoother;
- Find (), closest (), and is () can receive all DOM elements and JQuery objects as parameters.
All these new features, along with the entire bug fix list, are described in detail in the official blog.
Unfortunately, this includes some destructive changes, which have been highlighted in separate sections in the official updates by the team:
Change |
JQuery 1.5.2 example |
JQuery 1.6 example |
The data () method uses a broken number to create a camper format.
|
Data-max-value = "15" created {max-value: 15} |
Data-max-value = "15" created {maxValue: 15} |
Distinguishes Property from Attribute. Currently, the attr () method cannot be used to obtain the preperty value. To process the property value, the prop () and removeProp () methods are introduced. |
If the check box is selected, checkbox. attr ("checked") returns (true)
|
Checkbox. attr ("checked") returns an empty string. To determine whether to select an event, use $ (This). prop ("checked") or $ (This). is (": checked "). |
If nothing happens, the second change will affect the projects that intend to upgrade to 1.6.
This version was launched three months after 1.5 and one month after 1.5.2. At present, 1.7 of the work has started, and the JQuery team has accepted the function proposal.
JQuery is a JavaScript library for rapid Web development. It simplifies HTML document traversal, event processing, animation, and Ajax interaction.