The advantages of jquery compared to js: 1. You can write multiple entry functions; 2. jQuery’s API name is easy to remember; 3. jQuery’s code is concise (with an implicit iteration mechanism); 4. jQuery helps users Solved the browser compatibility problem; 5. The fault tolerance rate is high. If there is a problem with the previous code, the subsequent code will not be affected.
![What are the advantages of jquery compared to js](https://img.php.cn/upload/article/202111/16/2021111611293823809.jpg)
The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.
Advantages of jQuery over js
##Disadvantages of native JS:
- You cannot add multiple entry functions (window.onload). If you add more than one, the later ones will overwrite the previous ones.
- Native JS The API names are too long and difficult to remember
- Native JS sometimes causes code redundancy
- Some methods or attributes in native JS , there are browser compatibility issues
- The fault tolerance rate of native JS is relatively low, there is a problem with the previous code, and the subsequent code cannot be executed
The advantage of jQuery
- is that you can write multiple entry functions
- jQuery’s API name It’s easy to remember
- jQuery’s code is concise (with implicit iteration mechanism)
- jQuery helps us solve browser compatibility issues
- The fault tolerance rate is high. If there is a problem with the previous code, the subsequent code will not be affected
Recommended related tutorials:
jQuery video tutorial
The above is the detailed content of What are the advantages of jquery compared to js. For more information, please follow other related articles on the PHP Chinese website!