To use jQuery, you need to include it on the pages where you wish to take advantage of it. You can do this by downloading jQuery from their website at http://www.jquery.com. There is usually a choice between a “Production” version and a “Development” version. The first is for your live website, because it has been minified and compressed to take up the least amount of space, which is important for your visitors, whose browser will have to download the jQuery file along with the rest of your website. For testing and development, the “Development” version is best. It hasn’t been minified or compressed, so when you run into an error, you can actually see where in jQuery it happens.
A part of your page should now look something like this:
You can use jQuery from a CDN just like you would do with the downloaded version, only the URL changes. For instance, to include jQuery 1.5.1 from Google, you would write the following:
I suggest that you use this approach, unless you have a specific reason for hosting jQuery yourself. Here is a link to the jQuery CDN information from Google:
Or if you prefer to use it from Microsoft:
Read on to learn how to start using jQuery.