Home >Web Front-end >JS Tutorial >How to choose jquery version

How to choose jquery version

coldplay.xixi
coldplay.xixiOriginal
2020-12-11 10:59:572573browse

How to choose the jquery version: 1. It is recommended to choose the [jQuery 1.9] version on the computer side, and the PI is basically the same as higher versions; 2. It is recommended to choose the [jQuery 3.x] version on the mobile side.

How to choose jquery version

The operating environment of this tutorial: windows7 system, jquery1.9&&jQuery3.x version, thinkpad t480 computer.

Recommended: jquery video tutorial

##How to choose jquery version:

1. It is recommended to choose jQuery 1.9 version on the computer side for the following reasons:

  • is compatible with IE8. At present, it is still necessary for the computer side to be compatible with IE8 (management system except).

  • The API is basically the same as the higher version, and the shortcomings of the lower version have been repaired, such as: selector performance, non-standard method names, etc.

  • In version 1.9, there is the ".on()" function, which is a big brother in the event processing function world introduced in jQuery 1.7.

2. It is recommended to choose the jQuery 3.x version for the mobile terminal. The reasons are as follows:

The new one is definitely better. If it is not good, you still need it. Update? No reason is needed here.

Deprecated jQuery versions:

Versions lower than jQuery 1.7:

1. There is a big difference with the current high version API;

2. The performance of selectors and other aspects is not high.

2.x version:

1. The existence period is short (from version 2.0.0 to 2.2.4);

2. It is not as compatible with IE8 as version 1.9 ;

3. Nowadays, 3.x has been released for a long time, so it doesn’t make much sense to use the 2.x version.

Related free learning recommendations: javascript(Video)

The above is the detailed content of How to choose jquery version. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn