jQuery is currently the most widely used JavaScript library on the web. One of the many extensions to it is jQuery Mobile (written by the makers of jQuery), which gives you an excellent framework/library to use in building mobile friendly websites or applications. This book covers an overview to get you started quickly with using the jQuery Mobile library. Before reading this book, you will need to have a solid understanding of HTML (preferabley HTML5) and jQuery (or JavaScript). If you aren't there yet, I'm afraid that you will have a difficult time following the author. Some CSS is discussed, but it is rudimentary.
Chapter 1 walks you through building a very simple HTML page, including the jQuery and jQuery mobile files, and introduces you to HTML5 data attributes which are used extensively by jQuery Mobile. By making very few changes to an HTML document, you are able to see a dramatic transformation by utilizing jQuery Mobile.
Chapter 2 shows you how to add multiple "pages" on your mobile site, which may or may not be included in the same HTML file. It also discusses how jQuery Mobile handles links by default (using AJAX) and how to disable that if desired. Also covered is how to preload pages so they are ready immediately if the user clicks on them.
Chapter 3 covers how to format headers, footers and toolbars to enhance the look and ease of navigation through your mobile site. You will learn how to add stylish link buttons and icons (provided or custom) to your header and footer. Also covered is building navigation bars, which are normal unordered lists with some styling and jQuery Mobile magic added to them.
Chapter 4 digs deeper into working with lists. If you have worked at all with HTML, you know how many things can be organized in your standard unordered list. jQuery Mobile knows this and expects that you may have plenty of them. This chapter covers several different styles of formatting your unordered lists, including how to collapse and expand nested lists. It also shows you how to implement a simple JavaScript search utility to allow your users to filter down the shown list results.
Chapter 5 jumps into building a very simple example site for a hotel. This example provides a home page, a find us page, a page on the rooms available and a contact us page. It uses the techniques taught up to this point in a real-world albeit very basic way. For good measure it throws in a quick example of inserting a Google map, and the "tel" and "mailto" URL additions to your phone number and email address.
Chapter 6 covers using forms in a jQuery Mobile site to collect information from your users, how jQuery Mobile submits the data to the server (using AJAX), and how the results are handled when they are returned from the server. The examples use ColdFusion as the server side language for processing the form, which I found to be an odd choice. Don't let this bother you. It really has no consequence to the lesson and whatever server side language you use will work just fine. Also covered is how different form elements are styled and how some can be transformed into a very trendy mobile friendly format.
Chapter 7 covers how to use Modal Dialogs (pop up messages) to alert your users to something important, and how the different types of modal dialogs behave. Also covered are grids, which is a great way to organize data in a mobile site, and how to implement collapsible sections to save the valuable space on your mobile site.
Chapter 8 digs a little into the guts of jQuery Mobile and shows some ways adjust its configuration, and how to use some of its built in utilities. Also covered is dealing with how to style controls that you have added after the initial page load. This chapter is a bit of a dry read, and many readers won't have need of it. It is a nice reference to have included if you do need it.
Chapter 9 covers events that are unique to mobile environments such as swiping, touching (short and long), and orientation changes. These events are different than a normal HTML page, and jQuery Mobile handles all the heavy lifting involved. This chapter explains the API provided by jQuery Mobile so you can respond to these events.
Chapter 10 uses what you have learned so far to build a simple note taking web application. You learn how to use HTML5's local storage so that this app can be used offline and without using a server's database. Although it is a simple application, it does provide you with a good foundation that can easily be expanded upon.
Chapter 11 explains how the free ThemeRoller tool is used to build a customized theme for your mobile site, how some newer CSS3 features are rendered by different browsers, and how to include custom icons in your themes. By using the ThemeRoller tool, you can change the entire appearance of your mobile site with very little effort.
Chapter 12 introduces you to the PhoneGap project (phonegap.com), also known as Cordova, which can allow you to convert your HTML, CSS, and JavaScript mobile site into a native mobile application. By doing this, your application gains access to phone features such as GPS, the camera, and other device sensors, which allow it to do things that a mobile website simply can't. This chapter gives you an overview of how PhoneGap works, and why you may want to use it. For the details of how to actually convert to a native app, you will need to visit and read the PhoneGap site.
Chapter 13 wraps everything up with a simple RSS reader application. The app is built with HTML, CSS and JavaScript (using jQuery Mobile of course), and then converted to a native Android app using PhoneGap. Honestly this chapter seems to end the book feeling like it was cut short, but despite that, you get an idea of what is possible when building a mobile website or converted native application.
One important thing to keep in mind before purchasing this book is that the paper version is only 246 pages long, and a good portion of that is printed code samples. This is a good book for going over the essentials, giving you some useful tips, examples and ideas, but be prepared to dig into the web (jquerymobile.com is the best place to start) or other books for your details. This book is not meant to be an exhaustive resource on the subject. As long as you understand that going in, I think you will find this a great place to get you started on building a mobile site or application utilizing the power of jQuery Mobile.
No book is perfect, and one thing you should be aware of is that some older jQuery code is present in some of the examples, including the ".live" function, which has been deprecated and replaced by ".on". You can find everything you will need to adapt the code at jquery.com.
Disclosure: I was provided with a free copy of this book in return for reviewing it.