Home >Web Front-end >Front-end Q&A >There are several types of jquery libraries

There are several types of jquery libraries

青灯夜游
青灯夜游Original
2022-03-10 11:52:192182browse

There are two types of jquery libraries: 1. The production version "jquery.min.js", which is mainly used for products and projects after being compressed by tools or turning on gzip compression on the server; 2. The development version "jquery.js". js", mainly used for testing, learning and development.

There are several types of jquery libraries

The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.

jQuery is a fast and concise JavaScript framework. It is another excellent JavaScript code library (framework) after Prototype. It was released by John Resig in January 2006. The purpose of jQuery's design is "write less, do more", which means writing less code and doing more things. It encapsulates common JavaScript function codes, provides a simple JavaScript design pattern, and optimizes HTML document operations, event processing, animation design and Ajax interaction.

The core features of jQuery can be summarized as follows: It has a unique chain syntax and a short and clear multi-functional interface; it has an efficient and flexible CSS selector, and can expand the CSS selector; it has convenient plug-in extensions Mechanism and rich plug-ins. jQuery is compatible with various mainstream browsers, such as IE 6.0, FF 1.5, Safari 2.0, Opera 9.0, etc.

There are several types of jquery libraries.

The types of jquery libraries are divided into two types: production version (jquery.min.js) development version (jquery.js )

  • The development version is mainly used for testing, learning and development.

  • The production version is compressed by tools or turned on gzip compression through the server. It is mainly used for products and projects.

These two libraries do not need to be installed. They only need to be placed in the corresponding directories. When jquery is needed on a certain page, the library only needs to be introduced in the relevant html document. The location of the file is sufficient. You can write in the html page:

 <script src="..js/jquery.js" type="text/javascript"/>

Advantages of jQuery

1. Lightweight: The size after compression is only about 30KB.

2. Powerful selectors: jQuery allows almost all selectors from CSS1 to CSS3 as well as its own original selectors.

3. Excellent encapsulation of DOM operations: jQuery encapsulates a large number of commonly used DOM operations, making it easy for developers to write programs related to DOM operations.

4. Reliable event processing mechanism: jQuery event processing mechanism is quite reliable when processing event binding.

5. Perfect Ajax: jQuery encapsulates all Ajax operations in a function $.ajax(), allowing developers to concentrate on business logic when dealing with Ajax without having to worry about complex browser compatibility. And issues with the creation and use of XMLHttpRequest objects.

6. Do not pollute top-level variables: jQuery only creates an object named jQuery, and all its function methods are under this object. Its alias $ can also hand over control at any time and never pollute other objects.

7. Excellent browser compatibility: jQuery fixes some differences between browsers, so that developers do not have to build browser compatibility libraries before starting projects.

8. Chain operation method: The most distinctive thing about jQuery is its chain operation method - that is, a group of actions that occur on the same jQuery object can be written directly without repeated acquisition. object.

9. Implicit iteration: When using jQuery to find all elements with the ".myClass" class and then hide them, there is no need to loop through each returned element.

10. Separation of behavior layer and structure layer: Developers can use jQuery selector to select elements and then directly add events to the elements.

11. Rich plug-in support: jQuery’s easy extensibility has attracted developers from all over the world to write jQuery extension plug-ins.

12. Complete documentation: jQuery’s documentation is very rich, whether it is Chinese documentation or English documentation.

13. Open source: jQuery is an open source product.

[Recommended learning: jQuery video tutorial, web front-end video]

The above is the detailed content of There are several types of jquery libraries. 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