Accessing jQuery From Your Site
To start using jQuery, simply add a reference to the jQuery library as in the following example:
Of course, you will need to download jQuery from http://jQuery.com and save it in your site’s scripts folder for the location above to work. Also, the currently downloaded version may have a slightly different name as the version number is included in the file name.
Using a Content Delivery Network
Alternatively, you can connect to jQuery on a Content Delivery Network (CDN), such as one provided by jQuery, Microsoft, or Google, in the following manner:
A CDN offers the following advantages:
- A CDN has servers around the world, so it can serve up files closer to the client that requested them, so they download faster.
- Most web clients cache files by default, so the client may already have a cached copy of the jQuery script file and may not need to download it again.
Adding jQuery to your site or page is simple and fast. In my next article, I will talk about the syntax of jQuery and how to use it to select objects on a web page.