What are the advantages and disadvantages of native JS code and using JQuery to achieve the effect?

Source: Internet
Author: User

< 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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.