Jquery learning path 1

Source: Internet
Author: User

 

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,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.