From JavaScript to JQuery (1) Learning summary _jquery

Source: Internet
Author: User

So to speak, only a solid JavaScript skills, to be able to use a variety of JS library, and then get to the point!
1. Let's talk about the efficiency of jquery .
He is 4 times times slower than the standard JS Dom at the speed of the selector (the official said, I didn't make it up ...), so why do we have to use it?? The reason is very simple, the first JS is the application of the client, the speed of the impact is not so obvious, but must pay attention to when to use the jquery selector, when the JavaScript selector!
I personally understand that if the logic is easier when selecting objects, don't use the jquery selector, for example
<input type= "text" id= "name" >
Then only do simple verification, no complex operations, directly with document.getElementById ("name");
Don't use jquery's $ ("#ID") as easy as it looks, but use jquery for more complex, logical operations, such as 10
<input type= "checkbox" >
We check to delete their rows
$ ("input[checked]"). Parent (). Parent (). remove (); This ligatures approach is better in logic and maintainability!
2. We're here to talk about Cross-browser
General write JavaScript exist code if you want to run in the browser, some of the methods are not supported by the browser, you must modify the problem, and jquery has done a better job in this, supporting the mainstream browser, so that a code can be used in a variety of browsers the benefits
3. Next also talk about "Zonghai development"
It is now developed to emphasize high speed, quality and easy maintenance, using traditional JavaScript to write from scratch is able to write, but in the development process will have a great impact, and jquery has a rich library of plug-ins, so that the development efficiency greatly improved, you may say that a lot of Plug-ins library, see the API is exhausted , but jquery does well at this point, and each plugin has a detailed annotation and Domo that can be easily put into practical use.
It's the first time I've written something. Don't get angry. The next article will introduce some techniques for applying JavaScript and jquery in actual development, thank you.

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.