jQuery course introduction

What is jQuery

jQuery is a set of Javascript script libraries. You can find the "Javascript lightweight script library" series of articles in my blog. The Javascript script library is similar to the .NET class library. We encapsulate some tool methods or object methods in the class library to facilitate user use.

Note that jQuery is a script library, not a script framework. "Library" does not Equal to "framework", for example, "System Assembly" is a class library, and "ASP.NET MVC" is a framework. jQuery cannot help us solve the reference management and function management of scripts, these are what the script framework has to do.

The script library can help us complete coding logic and realize business functions. Using jQuery will greatly improve the efficiency of writing JavaScript code, making the written code more elegant and robust. At the same time, there are abundant jQuery plug-ins on the Internet. Let our work become "With jQuery, drink tea every day"-because we are already standing on the shoulders of giants.

When you create an ASP.NET MVC project, you will find that it has been automatically introduced jQuery class library. jQuery is almost Microsoft’s official script library! Perfect integration and intelligent sensing support allow .NET and jQuery to be seamlessly combined! Therefore, when using .NET, you must choose jQuery instead of Dojo, ExtJS, etc.

1) jQuery is a set of Javascript script libraries. Note that jQuery is a script library, not a script framework. "Library" does not equal "framework". jQuery cannot help us solve the reference management and function management of scripts. These are what the script framework has to do.

The script library can help us complete coding logic and realize business functions. Using jQuery will greatly improve the efficiency of writing JavaScript code, making the code written more elegant and robust.

2) Using these functional functions can help us quickly complete various functions and make our code extremely concise.

3) The compatibility of JavaScript scripts in different browsers has always been a nightmare for Web developers. For example, the Event object in jQuery has been formatted to be common to all browsers. In the past, event triggers had to be obtained based on the event. Or, under IE it is event.srcElements and under standard browsers such as FF it is event.target. jQuery unifies event objects, allowing us to use event.target to obtain event objects in all browsers.

4) jQuery can achieve animation effects such as gradient pop-up and layer movement, allowing us to obtain a better user experience.

5) Most developers have wrong understanding of JavaScript, such as writing statements to operate the DOM that are executed when loading in the page, directly adding the onclick attribute to the HTML element or document object, but they do not know that onclick is actually an anonymous functions and so on. Such a program is not robust. For example, "write statements in the page that are executed when loading to operate the DOM." When the page code is small and the user loads quickly, there is no problem. When the page loads a little slowly, the browser "terminates the operation" error will occur.


Continuing Learning
||
<!doctype html> <html lang="zh"> <head> <meta charset="utf-8"/> <title>Hello World jQuery!</title> <script src="jquery-3.1.1.min.js"></script> </head> <body> <div id="divMsg">Hello jQuery!</div> <input id="btnShow" type="button" value="show" /> <input id="btnHide" type="button" value="hidden" /><br/> <input id="btnChange" type="button" value="change content is Hello World, too!"/> <script> $("#btnShow").bind("click", function(event) { $("#divMsg").show(); }); $("#btnHide").bind("click", function(event) { $("#divMsg").hide(); }); $("#btnChange").bind("click", function(event) { $("#divMsg").html("Hello World, too!"); }); </script> </body> </html>
submitReset Code