Several features of jQuery that we must understand

  • 2020-06-03 05:52:37
  • OfStack

jQuery is a script library, not a script framework. "library" does not equal "framework". For example, "System assembly "is a class library and" ASP.NET MVC" is a framework. jQuery does not help us with reference management and function management of scripts, which is what script frameworks do.

Script library can help us complete the coding logic, the realization of business functions. Using jQuery will greatly improve the efficiency of javascript code, to write the code more elegant, more robust. At the same time on the Internet rich jQuery plug-in also let our work into "with jQuery, tea drinking water everyday" - because we have been standing on the shoulders of giants.

1. Provide a powerful function

Using these functions can help us accomplish various functions quickly and make our code extremely concise.

2. Fix browser compatibility issues

javascript scripts in different browser compatibility is 1 straight Web developer's nightmare, often a page on IE under normal operation, baffling problems in firefox. Write the script for the different for different browsers is a painful thing. With jQuery we will wake up from this nightmare, such as in jQuery Event event object has been formatted into all browsers universal, according to former event get event trigger, event. srcElements under ie and event. target. jQuery under ff and other standard browsers event. target. jQuery by using 1event object, we can use event. target to get the event object in all browsers.

3. Implement rich UI

jQuery can realize popup, such as the gradient layer mobile animation effects, let us get a better user experience. Single gradient effect, for example, once upon a time I wrote a compatible ie and the gradient ff animation, using a large number of javascript code realization, painstakingly, after writing without too much help after a period of time, and forget. Develop similar function even again painstakingly again. Now use jQuery can help us to quickly finish such applications.

4. Correct wrong script knowledge

This is my article 1, the reason is that most developers for javascript errors. For example, writing in the page load time is doing DOM statement, added directly on HTML elements or document object "onclick" attribute, don't know onclick is actually an anonymous function and so on. With these errors script intellectual and technical personnel can complete all the development work, but this program is not robust. Such as "writing in the page load time doing DOM statement". When page code small user load quickly when there is no problem, when the page loads slower browser "terminate operation" will appear when mistakes. jQuery provides many easy way to help us to solve these problems, use 1 denier jQuery you will correct these mistakes, because we are using standard right jQuery scripting methods!

That's all for this article, but it's not enough to generalize about jQuery. There's still a lot to discover.


Related articles: