To obtain a copy of the library, we should visit the download builder at http://jqueryui.com/download, which gives us a range of different options for building a download package that is tailored for our particular implementational requirements. The following screenshot shows the download builder:
We can either download the complete current release of the library, or a complete package of the legacy 1.6 version, or we can select the components that we want and download a custom package.
Note
This book is specifically tailored towards version 1.7 of jQuery UI (at the time of writing the current stable release is 1.7.2) and is not compatible with legacy versions of the library. jQuery UI 1.7 requires jQuery 1.3.
The page is laid out in a really friendly and easy-to-use way. It lists all of the different components in their respective groupings (core, interaction helpers, and widgets) and allows us to choose from one of 25 different predesigned themes along with providing information about the package (including both its compressed and uncompressed size).
We'll look at the different files found within the library in just a moment, but for now we should download the complete library. It will contain everything we need, including the JavaScript and CSS files, as well as any images from the current theme that different components rely on. It even contains the latest version of jQuery itself, so we don't need to worry about downloading this separately.
For now, just use the Current (stable) link at the top of the page. This will give us the default theme that is called smoothness. We'll look at downloading and using other themes in the next chapter.
Tip
Hosted Files
In reality, we don't even need to download the library in order to implement it in a production web application. Both jQuery and jQuery UI are hosted on Google's content delivery network (CDN), so we can include <script>
elements that link to these files instead of using local versions. Only the complete library (not individual components) is available, although there are a range of different releases.
On a live site that receives a lot of international traffic, using a CDN will help ensure that the library files are downloaded to a visitor's computer from a server that is geographically close to them. This helps in making the response quicker for them and saving our own bandwidth. This is not recommended for local development however.