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.