Advertisement
Google Ad Slot: content-top
jQuery Installation
Adding jQuery to Your Web Pages
You can install and use jQuery in your project in two main ways
- Download the jQuery library from jQuery.com
- Include jQuery from a CDN, like Google
1. Using jQuery via CDN
A CDN (Content Delivery Network) lets you include jQuery in your website without downloading it.
It loads jQuery from a remote server that's fast and globally distributed.
Include the jQuery <script> tag in your HTML file. You can place it inside the <head> or just before the closing </body> tag.
2. Download and Host jQuery Locally
When downloading jQuery, you'll find two versions available:
1. Compressed (Minified) Version
- Filename:
jquery-3.6.0.min.js - Use Case: Ideal for production websites
- Why: Smaller file size → faster loading
- Looks like: All code is squished into one line (not readable by humans)
2. Uncompressed (Development) Version
- Filename:
jquery-3.6.0.js - Use Case: Best for development and debugging
- Why: Easy to read, with proper spacing and comments
- Looks like: Regular JavaScript code with documentation
Visit the official download page:
👉 https://jquery.com/download/
You’ll see options to:
- Download the compressed or uncompressed version
- Copy the CDN link
- Use jQuery with a package manager (like npm or yarn)