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

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.

主站蜘蛛池模板: 松江区| 汝南县| 介休市| 扶沟县| 乌拉特中旗| 霍州市| 南宁市| 德安县| 阿城市| 读书| 贵港市| 新民市| 自贡市| 灌南县| 双牌县| 手游| 镇平县| 镇沅| 婺源县| 昌宁县| 睢宁县| 文登市| 甘谷县| 象山县| 色达县| 东辽县| 临沂市| 醴陵市| 青龙| 兴隆县| 太谷县| 成安县| 游戏| 宝鸡市| 临潭县| 定结县| 临汾市| 石河子市| 崇信县| 肥城市| 兴化市|