Improved JQuery 1.6 performance and a large number of disruptive changes

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.