How to run jQuery on local machine

How to run jQuery on local machine

In this lesson we will learn how to run jQuery on local machine. Running jQuery needs you to run it locally or use the CDN based environment.

  • Downloading 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 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 with the local working,

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 jQuery library in your HTML code,

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

Microsoft CDN

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

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

In this lesson we learned how to run jQuery on 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
Studyopedia Editorial Staff
[email protected]

We work to create free tutorials for all.

No Comments

Post A Comment