Adding jQuery to Your Web Site
There are two ways to start using jQuery
- Download the jQuery library from jQuery.com
I always prefer this way, because if you download and add the file in your local folder, you know exactly which version you are using, and where to add reference
- Second way, just include jQuery path from a CDN, like Google or Microsoft
There are always two versions of jQuery available for downloading:
- Production version: You should always use this version, becasue it has been tested, minified and compressed
- Development version - this is for testing and development, this version may have some issues, or may not be stable, avoid this
How to include jQuery?
Just add the jQuery file reference inside the head tag of your webpage.
Install jQuery using NuGet Manager
If you are using Jquery in Asp.Net application, you can add Jquery files using nugget manager as shown below.
Make sure you have added reference in BundleConfig.cs
Downloading jQuery using npm or Bower
install the latest version of jQuery with the npm
npm CLI command
install the latest version of jQuery with the Bower
bower install jquery
Once setup done, let's understand how jQuery works