To obtain a copy of the library, we should visit the download builder at http://jqueryui.com/download. This tool 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 (version 1.8.9 at the time of writing), or a complete package of a legacy version. We can also select just the components that we want and download a custom package.
Note
This book is specifically tailored towards version 1.8, which is above of jQuery UI and requires jQuery 1.3.2 or higher. To support older versions of jQuery, the legacy version 1.7.3 is also available from the download builder.
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 24 different predesigned themes (or no theme at all). The page also provides 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 Stable link at the top of the page. This will give us the default theme, which is called smoothness . We'll look at downloading and using other themes in the next chapter.
Tip
Hosted Files
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 and Microsoft's
Content Delivery Networks (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.
Google's CDN can be found at: http://code.google.com/apis/libraries/.
Microsoft's CDN can be found at: http://www.asp.net/ajaxlibrary/cdn.ashx.