How to reference jQuery in a web page

How to reference jQuery in a web page
It can be referenced through CDN (Content Delivery Network). jQuery is stored on both Google and Microsoft's servers.

Google CDN:

Copy code
The code is as follows:

<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js">
</script>
</head>


Get the latest available version via Google CDN:

If you observe the URL on Google - the jQuery version (1.8.0) is specified in the URL. If you want the latest version of jQuery, you can either remove a number from the end of the version string (such as 1.8 in this case) and Google will return the latest available version in the 1.8 series (1.8.0, 1.8.1, and so on) or leave the first number alone and Google will return the latest available version in the 1 series (from 1.1.0 to 1.9.9).

Microsoft CDN:

Copy code
The code is as follows:

<head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js">
</script>
</head>

Using jQuery from Google or Microsoft has one big advantage:

Many users have already loaded jQuery from Google or Microsoft when visiting other sites. All the result is that when they visit your site, jQuery will be loaded from cache, which should reduce loading times. At the same time, most CDNs can ensure that when a user requests a file, a response is returned from the server closest to the user, which can also increase loading speed.

<<:  CSS implements six adaptive two-column layout methods

>>:  Detailed tutorial of using stimulsoft.reports.js with vue-cli

Recommend

React Principles Explained

Table of contents 1. setState() Description 1.1 U...

In-depth understanding of Vue's method of generating QR codes using vue-qr

Table of contents npm download step (1) Import (2...

Detailed explanation of the correct use of the count function in MySQL

1. Description In MySQL, when we need to get the ...

...

mysql three tables connected to create a view

Three tables are connected. Field a of table A co...

How to solve the mysql error 1033 Incorrect information in file: 'xxx.frm'

Problem Description 1. Database of the collection...

Native JS object-oriented typing game

This article shares the specific code of JS objec...

Vue project packaging and optimization implementation steps

Table of contents Packaging, launching and optimi...

CSS3 property line-clamp controls the use of text lines

Description: Limit the number of lines of text di...

DIV common attributes collection

1. Property List Copy code The code is as follows:...

How to use @media in mobile adaptive styles

General mobile phone style: @media all and (orien...

Instructions for recovering data after accidental deletion of MySQL database

In daily operation and maintenance work, backup o...