Downloading the library
This book is specifically tailored towards Version 1.10 of jQuery UI and requires jQuery 1.6 or higher; throughout this book, we will be using jQuery 2.0.3 in our code samples.
Note
If you still need to support IE6 then the legacy Version 1.9.2 of the jQuery UI library is also available for download. You will also need to avail yourself of a copy of jQuery 1.10, as jQuery 2.0 does not support IE 6-8.
To obtain a copy of the library, we should visit the Download Builder at http://www.jqueryui.com/download. This tool gives us a range of different options for building a download package that is tailored to our particular requirements. The following screenshot shows the Download Builder:
We can either download the complete current release or a complete package of a legacy version. We can also select just the components that we want and download a custom package—this is particularly recommended for production environments, where we are only using a subset of the UI library; this helps to reduce bandwidth used when viewing the page.
The page is laid out in a friendly and easy-to-use way. It lists all of the different components in their respective groupings (UI Core, Interactions, and Widgets) and allows us to choose from one of the 24 different predesigned themes (or no theme at all). The page also provides information about the package (including both its compressed and uncompressed size).
Tip
If as a developer you would like to see the latest snapshot of jQuery UI under source control, then you can download a copy from GitHub, which is available at https://github.com/jquery/jquery-ui.
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 rely on different components. 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 custom Download link at the top of the page then select Smoothness as the theme on the following page, and then click on Download. We'll look at downloading and using other themes in the next chapter.
The code download that accompanies this book includes a copy of jQuery 2.03 within each chapter's exercise folder. If you need to download a new copy, you can do so—the instructions for downloading a new copy are listed in Appendix, Help and Support.
Using the hosted versions of jQuery UI
We don't need to download the library in order to implement it in a production web application. Both jQuery and jQuery UI are hosted on content delivery networks (CDN) provided by Google, CDNJS, Microsoft, and MediaTemple (who provide the CDN for the jQuery UI).
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!
Tip
Hosted Files
If you would like to take advantage of using the CDN links, then these can be found at the following locations:
Google's CDN: http://code.google.com/apis/libraries/
CDNJS's CDN: http://cdnjs.com
jQuery's CDN: http://code.jquery.com
Microsoft's CDN: http://www.asp.net/ajaxlibrary/CDN.ashx