New versions of JQuery 2.2 and 1.12 released

Source: Internet
Author: User

New Year's Day, the JQuery team released two newer versions yesterday: 1.12 and 2.2. These two versions contain a number of bug fixes and feature improvements. Basically this will be the last release before 3.0. However, since 3.0 is not backwards compatible, the JQuery team will continue to maintain these two versions, certainly only bug fixes. The news about 3.0 will be announced shortly.

So what has changed in the new version?

Performance improvements

This version shortens the reference path for Sizzle, which querySelectorAll matchesSelector can lead to performance gains when native and unusable. The effect is obvious in the production environment.

New features

Small upgrade a lot, here only to say the important.

Class operations for SVG

As an HTML library, it is a legitimate support for SVG elements. The new version of this can be used, and, the .addClass() .removeClass() .toggleClass() .hasClass() operation of SVG objects class . It is important to note, however, that there are many differences between SVG and HTML, so it is better to choose a more specialized class library If you really want to do complex operations.

Jquery.post and Jquery.get Support object parameters

Title:

jQuery.post({  url: “/example”});

The benefits are much more, such as setting a callback function context or cross-domain post withCredential: true .

New operator Support

Support for new operators introduced by ES6/ES2015, JQuery objects can be for-of traversed.

for (element of $elements) {  console.log(element);}
jQuery.htmlPrefilter()

HTML5 does not require tags to be closed, but XML is required. This function is used for conversion. In this way .html() , .append() we .replaceWith() do not need to convert manually when we use it. In turn, we don't need to be so strict with the validation input.

jQuery.uniqueSort()

jQuery.unique()Naming a bit of a problem, failed to reflect the sort, so this time renamed jQuery.uniqueSort() . jQuery.unique()remain, but only the latter will be recorded in the document.

This function focuses on the sorting and discharging of the DOM nodes, so do not use them indiscriminately.

Summarize

This version is theoretically not much changed and can be upgraded smoothly. But if there is any problem with the black face, please report it to the official.

New versions of JQuery 2.2 and 1.12 released

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.