< Span class= "o" > < Span class= "p" > < Span class= "p" >
- Various kinds of encapsulation, the main purpose is to worry , take the JQ to say :
- JQ for different browser events, DOM objects, are encapsulated, Various operations can be directly compatible with a variety of browsers, to know that the difference between different browsers is not only in the CSS to write "-webkit-" or "filter" the difference, even the event model of the underlying things are different = =
- JQ-specific css-like selector, Chained notation, the various types of animate functions encapsulated, the encapsulated asynchronous loading, all significantly improve development efficiency, reduce duplication of labor
- JQ uses delay and a series of functions to encapsulate the AJAX operation, the function of visual inspection is continuously improved and perfected. Anyway, it's better than JS worry.
- Other is some commonly used function JQ have so do not write yourself, such as browser detection ...
- plugins are rich, informative, and so on
< Span class= "NX" >< Span class= "Mi" > < Span class= "NX" >
- JQ is 10 times times slower than native JS (Chrome) ~100 times (IE). The number of forgotten, anyway is this order of magnitude ... In particular, some people like to abuse selectors and don't use chained notation.
< Span class= "p" > < Span class= "NX" > You can write your own code according to your own business without using frames. , more targeted, no redundant code, the disadvantage is that if the lack of experience of code compatibility and scalability is poor, the level of code abstraction is low, to do a good job requires experience and a lot of time and energy, and finally may form their own framework.
What are the advantages and disadvantages of native JS code and using JQuery to achieve the effect?