Because the company did not develop the project for a long time for ** reasons, during this time it was just a bit of maintenance work. To put it bluntly, it would be a time for the company to get involved, when I was bored, I downloaded a lot of e-books to learn new things,
Let's talk about jquery first.
I have to say that this is a good thing. jQuery is a fast and concise javaScript library that allows users to easily process HTML documents, events, and achieve animation effects, it also facilitates AJAX interaction for websites. He can write less code and do more. That's exactly how I fell in love with him. basic tutorial, in addition to studying after work, I also learned one or two points from my book after work, often doing a variety of experiments.
Of course, remember that my first experiment is still the most classic "Hello World" (Example 1)
$(document).ready(function(){
alert("Hello World");
});
Here, let's take a look at how to implement it using traditional js: (Example 2)
<body onload="alert('hello world');">
The above two sections of code have the same actual effect!
Ah! No, it's as simple as using traditional js. It can be done in one sentence. Why should jquery be used;
However, after careful analysis, you will find that the advantage of [Example 1] is the separation of performance and logic. For example, if you want to use the same functions on multiple pages (for example, when this dialog box is displayed), you only need to save [Example 1] As a js file, reference on the required page.
At this time, you may think, I will directly create a JS file, write the method in it (for example, the empty dialog box-alert ("hello world") will pop up), then save it, the required page references this js and then calls this method. You may find any difference here, right, the key lies in the difference in this "call" (of course there are other differences, I would like to emphasize this here). This is also one of jquery's outstanding features, performance and logic separation, basically, many Jqeury plug-ins use this feature. Because of this feature, multiple plug-ins are used together and will not conflict during initialization.
This is just an entry to jquery. This is an example that gives me a strong interest in it,