Master Mobile Web Apps with jQuery Mobile
NOTE This book is now on its 3rd edition. Read my review of Master Mobile Web Apps with jQuery Mobile, Third Edition.
A couple of weeks ago, my boss basically said “Hey wanna learn jQuery Mobile?”. So, as is my habit, I went out to the interwebs looking for a book, and Master Mobile Web Apps with jQuery Mobile, by Matt Doyle, is the one I found. It is an excellent introduction to jQuery Mobile (JQM), an “interface framework for mobiles” (p24) that is still, at the time of this review, in beta. JQuery Mobile is built on top of jQuery, uses principles from jQuery UI, and also includes a CSS theme framework.
After the rapid-fire example, Part II rewinds to start with the basic structure of jQuery Mobile pages, and continues through some of the major user interface elements: buttons in all their incarnations; footers, headers, and navbars; dialogs; forms; the many variants of listviews; and plain old page content. The author’s descriptions are clear and well-organized, and most code blocks are followed by an appropriate level of step-by-step explanation.
Going beyond default
Part II: “JQuery Mobile Essentials” digs deeper, explaining how to get jQuery Mobile to depart from its default look, feel, and functionality. Chapter 10 focusses on the theme framework — editing and applying your own theme “swatches” to UI components, as well as creating and using your own standard and high-def icons. Going beyond the CSS, Chapter 11 introduces the jQuery Mobile API, including initialization options and all the exposed methods and events.
The last chapter walks through an entire mobile to-do app, from start to finish. It’s a tidy example that takes the reader through many common facets of developing a web app — like a building a login process and handling errors.
What’s here that isn’t in the jQuery Mobile Docs?
JQuery Mobile, following the precedent set by the jQuery docs, has thorough and well-organized documentation. Nevertheless, finding something in the documentation means you have to know what you are looking for, or be lucky enough to stumble upon it. The nice thing about a non-reference book is that it has a direction: read it from beginning to end, and you will encounter (and hopefully learn) everything it has to offer. In addition, Master Mobile Web Apps puts the functionality in context and covers bugs and “gotchas” you might come across. For example, on page 238 the author clarifies the distinction between the
create event and the
refresh method, and when you’d want to use each.
The fact that JQM docs are themselves jQuery-Mobile-powered means you can see many of its features implemented in a real-life context, but also means explanatory source code blocks are mostly absent, and it’s a little tedious to view the source of a given page. Master Mobile Web Apps provides all the example code in a zip file, making it simple to learn from the code as well as edit and add to the files to experiment on your own.
This book also contains two really useful Appendices. Appendix A breaks down the process by which jQuery handles URLs and page requests. Appendix B is a complete table of all the
data- attributes, describing their function and what elements they can be used on.
You might be hesitant to purchase a book on a framework that is still in beta, but the author assures readers that “we’re planning to publish updated versions of this ebook to keep it up to date with the current version” and updates will be “free to people who have already purchased an earlier version of the ebook”. In fact, with jQuery Mobile’s third beta release just out, I’m looking forward to the next installment of this excellent book.
3 comments so far…Your thoughts
Comments are closed for this article.