How to run jQuery on local machine

Learn how to run jQuery on the local machine. Running jQuery needs you to run it locally or use the CDN-based environment.

  • Downloading the Local Version and adding it to the HTML code, whereas
  • CDN (Content Delivery Network) based means adding jQuery library into the HTML code directly from CDN.

Downloading jQuery Local Version

Under local development, two versions are provided,

  • Production jQuery– Version for running on a live website. It is a compressed version.
  • Development jQuery– Version for testing and development. It is an uncompressed version.

Here, you can see the screenshot, which is displaying both the downloads,

jQuery Production and Development versions

Let’s work around running jquery on the local system:

Step 1- Visit the jQuery Downloads page and download jQuery. The current version is 3.2.1.

Step 2- We downloaded jquery-3.2.1.min.js file and now place it under the same directory files where you have created your website pages. Here, we will see the location,

We create our project folder with the name Studyopedia,

Now add the downloaded file jquery-3.2.1.min.js in the same directory.

Before delving into CDN-based working of jQuery, let’s see how we can work with the jQuery library on our local system. Assuming jquery-3.2.1.mim.js is downloaded and saved on local system:

jQuery Content Delivery Network (CDN)

If you don’t want to delve into downloading and adding the jQuery file to your local system, then there’s an additional option available. Go with the CDN-based version and include jQuery in your HTML code directly from the CDN.

Here, we have two options for CDN as well i.e. Google and Microsoft,

Google CDN

Here’s how you can work with Google CDN to include the jQuery library in your HTML code,

Here’s how you can include the jQuery library with Google CDN:

Microsoft CDN

Here’s how you can work with Microsoft CDN to include the jQuery library in your HTML code,

Here’s how you include the jQuery library with Microsoft CDN,

In this lesson, we learned how to run jQuery on the local machine by first downloading it. We also saw how to begin with jQuery without downloading it i.e. using CDN.

jQuery Introduction
jQuery Syntax
Studyopedia Editorial Staff
[email protected]

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading