Learn jquery from scratch (i)

Source: Internet
Author: User

First, what is jquery

jquery is another excellent JavaScript library following prototype. It is a lightweight JS library, it is compatible with CSS3, also compatible with various browsers (IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+), jQuery2.0 and subsequent versions will no longer support Ie6/7/8 browser. jquery makes it easier for users to work with HTML (an application under the standard Universal Markup Language), events, animate, and easily provide Ajax interactivity to the site. One of the big advantages of jquery is that its documentation is full, and the various applications are very detailed, as well as a number of mature plugins to choose from. jquery allows the user's HTML page to keep the code and HTML content separate, that is, no more inserting a bunch of JS in the HTML to invoke the command, only need to define the ID. In general, after using jquery, we can no longer write a bunch of JavaScript code and use jquery's simple code to make it work.

Ii. how to get and use jquery

2.1 How to get jquery:

2.1.1 to official website download: http://jquery.com/, there are two versions

    • Production version-used in the actual website, has been streamlined and compressed.
    • Development version-for testing and development (uncompressed, readable code)

2.1.2 Load CDN:CDN refers to the content distribution network

If you don't want to download and store JQuery, you can also refer to it through a CDN (content distribution network).

Baidu, the cloud, Sina, Google and Microsoft servers are all in JQuery.

If your site users are domestic, the proposed use of Baidu, and Pat Cloud, Sina and other domestic CDN address, if you site users are foreign can use Google and Microsoft.

2.1.3 Refer to third-party plugins (jquery or other) via NuGet (what is NuGet?). Own Baidu to go), personally think through this way of experience the best. It is recommended to use this method, especially for beginners.

2.2 How to use jquery

2.2.1 uses NuGet to refer to jquery, install NuGet First, then right-click the project-Manage NuGet packages, select online on the left, enter jquery, and then install.

After the installation, we found that there are four of files. Note in particular that one of the Vsdoc files is a smart sensor file for jquery, with which we can easily and quickly code. If you don't get jquery through NuGet, you'll need to download the corresponding Vsdoc file yourself.

How do I use jquery? We can refer to jquery in the page head tag where we need to use jquery. SRC refers to the physical location of the file where jquery is stored.

  <script type= "Text/javascript" src= "Scripts/jquery-2.1.3.js" ></script>

2.2.2 Through the CDN load, domestic words generally use Baidu CDN load.

  

And Pat the clouds Cdn:

  

Sina cdn:

Here we have a basic understanding of how to get and use jquery.

  

Learn jquery from scratch (i)

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.