官术网_书友最值得收藏!

Getting jQuery Mobile

In the preface, we talked about how jQuery Mobile is just a set of files. This wasn't said to minimize the amount of work done to create those files or to play down how powerful they are, but to emphasize that using jQuery Mobile means that you don't have to install any special tools or server. You can download the files and simply include them in your page. And if that's too much work, you have an even simpler solution. jQuery Mobile's files are hosted on a Content Delivery Network (CDN). This is a resource hosted by them and it is guaranteed (as much as anything like this can be) to be online and available. Multiple websites are already using these CDN hosted files. This means that when users hit your website, they may already have the resources in their cache. For this book, we will be making use of the CDN hosted files. Just for this first example, we'll download the ZIP file and extract the files we need.

Tip

I recommend doing this anyway for the times when you're on an airplane and wanting to whip up a quick mobile website.

To grab the files, visit http://jquerymobile.com/download. There are a few options here, but you want the ZIP file option. Go ahead and download the ZIP file and extract it (the ZIP file you downloaded earlier from GitHub has a copy already). The following screenshot demonstrates what you should see after extracting the content from the ZIP file:

Note

An important note: at the time this book was written, jQuery Mobile was at version 1.4.5. Obviously, by the time you read this book, a later version may be released. The filenames you see listed in the previous screenshot are version-specific, so keep in mind that they may look a bit different for you.

The ZIP file contains demos and both the minified and regular versions of the jQuery Mobile framework. Additional files are provided for theming and other purposes, but your main concern will be with jquery.mobile-1.4.5.min.css and jquery.mobile-1.4.5.min.js. You will typically want to use the minified version in your production apps though. The images folder contains various images used by jQuery Mobile's CSS file. Of course, you also need to include the jQuery library.

Note

You can download this separately at http://www.jquery.com.

主站蜘蛛池模板: 通榆县| 宜川县| 怀远县| 手游| 勐海县| 威信县| 姜堰市| 临泉县| 高陵县| 宁都县| 南涧| 威远县| 唐海县| 蓬安县| 威宁| 余江县| 温宿县| 洪洞县| 兰考县| 车险| 辽阳市| 社旗县| 宾阳县| 清水县| 修武县| 武宁县| 城口县| 重庆市| 遵义县| 个旧市| 丹江口市| 阳西县| 惠州市| 宁都县| 浦东新区| 南陵县| 鄂尔多斯市| 尼玛县| 南澳县| 滁州市| 奈曼旗|