Jquery basic notes one

## Today's content
    1. JQuery basics:
        1. Concept
        2. Quick start
        3. Difference and transformation between JQuery object and JS object
        4. Selector
        5. DOM operation
        6. Case

# JQuery basics:
    1. Concept: a JavaScript framework. Simplified JS development
        * jQuery is a fast and concise JavaScript framework, and is another excellent JavaScript code library (or JavaScript framework) after Prototype. The purpose of jQuery design is "write Less, Do More", that is, advocating to write less code and do more. It encapsulates JavaScript commonly used function codes, provides a simple JavaScript design mode, and optimizes HTML document operation, event handling, animation design, and Ajax interaction.

        * JavaScript framework: essentially some js files, encapsulating the native code of js
    2. Quick start
        1. Steps:
            1. Download JQuery
                * There are currently three major versions of jQuery:
                    1.x: compatible with ie678, the most widely used, Officials only do BUG maintenance, and
                         no new functions are added. Therefore, for general projects, you can use the 1.x version, the
                         final version: 1.12.4 (May 20, 2016)
                    2.x: not compatible with ie678, few people use it, the official only does BUG maintenance, the
                         function is not Add again. If you do not consider compatible low-version browsers, you can use 2.x, the
                         final version: 2.2.4 (May 20, 2016)
                    3.x: not compatible with ie678, only the latest browser is supported. Unless special requirements, the
                         3.x version is generally not used, and many old jQuery plugins do not support this version.
                         The current version is the official main update and maintenance version. Latest version: 3.2.1 (March 20, 2017)
                * The difference between jquery-xxx.js and jquery-xxx.min.js:
                    1. jquery-xxx.js: development version. For programmers, there are good indentation and comments. Larger volume
                    2. jquery-xxx.min.js: production version. Used in the program without indentation. Smaller size. The program loads faster

            2. Import JQuery js file: Import min.js file
            3. Use
                var div1 = $("#div1");
                   alert(div1.html());
    3. Difference and conversion between JQuery object and JS object
        1. JQuery object In operation, it is more convenient.
        2. The methods of JQuery object and js object are not universal.
        3. Convert between the two
            * jq -> js: jq object [index] or jq object. get (index)
            * js -> jq: $(js object)

 

Guess you like

Origin blog.csdn.net/SSbandianH/article/details/109799570