JQuery is a fast and concise JavaScript library that allows you to easily process HTMLdocuments, events, and animation effects, and easily provide AJAX interaction for websites. Its documentation is comprehensive, and various applications are also detailed. There are also many mature plug-ins to choose from. JQuery is a script library, not a script framework. "library" is not equal to "framework". For example, "System assembly" is a class library, while "ASP. net mvc "is the framework. jQuery does not help us solve the Reference Management and function Management of scripts. These are what the script framework is doing.
The script library can help us complete the encoding logic and implement business functions. using jQuery will greatly improve the efficiency of writing javascript code and make the written code more elegant and robust. at the same time, the rich jQuery plug-ins on the network have turned our work into "drinking tea every day with jQuery"-because we have already stood on the shoulders of giants.
1. provides powerful functions
Using these functions can help us quickly complete various functions and make our code very concise.
2. Solve browser compatibility issues
The compatibility of javascript scripts in different browsers has always been a nightmare for Web developers. A page often runs normally in IE, and some inexplicable problems occur in Firefox. writing different scripts for different browsers is a pain point. with jQuery, we will wake up from this nightmare. For example, the Event event object in jQuery has been formatted as common in all browsers. In the past, we had to obtain the Event Trigger Based on the event, in ie, It is event. under the standard browser such as srcElements and ff, event.tar get. jqueryis a unified eventobject, so that we can use event.tar get in a browser to get the event object.
3. Implement rich UI
JQuery can achieve animation effects such as gradient pop-up and layer movement, so that we can have a better user experience. taking the gradient effect as an example, I wrote a gradient animation that is compatible with ie and ff. It was implemented using a large amount of javascript code, so it took a lot of effort to avoid it, after writing the script, I forgot it for a while without much help. it is effort-consuming to develop similar functions. now, using jQuery can help us quickly complete such applications.
4. Script knowledge for Error Correction
I proposed this article because most developers have incorrect understanding of javascript. for example, compile the DOM statement that is executed during loading on the page, directly add the "onclick" attribute to the HTML element or document object, and do not know that onclick is actually an anonymous function. technicians with these error scripts can complete all the development work, but such programs are not robust. for example, "write the DOM statement that is executed when loading in the page", there is no problem when the Page code is very small and users load quickly, when the page loading is slow, the browser "stop operation" error will occur. jQuery provides a lot of simple methods to help us solve these problems. Once jQuery is used, you will be able to correct these errors-because we all use standard and correct jQuery scripting methods!
The above is all the content of this article. Of course, this cannot summarize the features of jQuery, and there are many to be found.