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

Example of implementing the Graphql interface in Vue

Note: This article is about the basic knowledge p...

Vue shopping cart case study

Table of contents 1. Shopping cart example 2. Cod...

How to build php-nginx-alpine image from scratch in Docker

Although I have run some projects in Docker envir...

Native js implementation of slider interval component

This article example shares the specific code of ...

Binary Search Tree Algorithm Tutorial for JavaScript Beginners

Table of contents What is a Binary Search Tree (B...

JS implements city list effect based on VUE component

This article example shares the specific code for...

What scenarios are not suitable for JS arrow functions?

Table of contents Overview Defining methods on an...

Detailed explanation of Vue two-way binding

Table of contents 1. Two-way binding 2. Will the ...

Detailed examples of replace and replace into in MySQL into_Mysql

MySQL replace and replace into are both frequentl...

How to recover deleted MySQL 8.0.17 root account and password under Windows

I finished learning SQL by myself not long ago, a...

Detailed explanation of MySQL Explain

In daily work, we sometimes run slow queries to r...

Summary of the use of TypeScript in React projects

Preface This article will focus on the use of Typ...

Detailed explanation of MySQL sql99 syntax inner join and non-equivalent join

#Case: Query employee salary levels SELECT salary...