jQuery UI in Action
TJ VanToll
Copyright
For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact
Special Sales Department Manning Publications Co. 20 Baldwin Road PO Box 761 Shelter Island, NY 11964 Email:
orders@manning.com2015 by Manning Publications Co. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps.
Recognizing the importance of preserving what has been written, it is Mannings policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled and processed without the use of elemental chlorine.
| Manning Publications Co.20 Baldwin RoadShelter Island, NY 11964 | Development editor: Sean DennisTechnical development editor: Teresa BurgerCopyeditor: Teresa WilsonProofreader: Elizabeth MartinTypesetter: Gordan SalinovicCover designer: Marija Tudor |
ISBN 9781617291937
Printed in the United States of America
1 2 3 4 5 6 7 8 9 10 EBM 19 18 17 16 15 14
Brief Table of Contents
Table of Contents
Foreword
jQuery has taken the web development community by storm. It has done this by building an API that is approachable for designers and new developers while simultaneously providing the power and extensibility desired by the most advanced and experienced developers. jQuery is easy to learn, easy to extend, and paves over browser differences, making it the go-to choice for millions of developers.
jQuery UI takes the same philosophies used to build jQuery and applies them to various aspects of UI creation. Building elegant interfaces with powerful, customizable widgets should be just as easy as showing and hiding elements. jQuery UI delivers on this promise while addressing often ignored issues such as accessibility and extensibility.
jQuery UI has built a solid base over the past seven years and the number of users is growing steadily. But the web is evolving at a rapid pace and new JavaScript libraries and UI toolkits are popping up left and right. Choosing the right tools for your next project can be quite daunting. jQuery UI in Action shows how to leverage jQuery UI to quickly build an application or just add an extra touch of interaction on an existing page.
This book will serve as a fantastic resource for anyone interested in getting started with jQuery UI. As always, TJ has done a great job of walking through tasks in detail and pointing out potential pitfalls. TJs dedication and desire to help others has been an invaluable asset, not just to jQuery UI, but to the web development community as a whole. Im sure youll feel the same way after reading this book.
S COTT G ONZLEZ
P ROJECT L EAD , J Q UERY UI
Preface
In 2013 Manning contacted me about writing a book on jQuery UI. Because I had been an enthusiastic user of the library for five years, and had been a member of the jQuery team for approximately two years, I had a lot of experience and knowledge that I wanted to share with the world. I said Yes!
From the start, I made it clear that I wanted to take a different tack with this book: rather than reprinting the librarys API documentation in a book, which is something I think far too many tech books do, I wanted to write about how to use the jQuery UI components in real-world usage scenarios and applications. I also wanted to tackle the tough questions for jQuery UI users. Why should you use the jQuery UI datepicker instead of the native date picker included in HTML5? How do you use jQuery UI on mobile devices, especially in low bandwidth situations?
From start to finish the book took about a year and a half to complete, and although it was an exhausting amount of work, Im extremely happy with the result. jQuery UI is a stable library that helps you write robust, accessible, and cross-browser friendly web applications today. This book represents my attempt to share the knowledge Ive gained from building countless projects with jQuery UI, and from working as a member of the jQuery team. I hope you enjoy it.
Acknowledgments
I never thought that I would be writing one of these ... I feel like Im at the Oscars or something. Although I hate to list specific names, as it will force me to exclude people I should thank and itll be totally awkward the next time I see them, Ill do it anyway ... otherwise this section would be kind of boring.
Ill start with Scott Gonzlez, who brought me into the jQuery project, walked me through countless jQuery concepts, and has always been around to help with any problem I run into. In addition to helping me with all things jQuery UI over the last few years, Scott also contributed the foreword to this book.
Next Ill thank Jrn Zaefferer, whose expertise has made me a better developer during my time with jQuery UI. I asked Jrn to perform the technical review of this book because I felt he was the most qualified person for the job (he is the original author of a good chunk of the jQuery UI source), and I wasnt disappointed. The book is unquestionably better because of Jrn.
The entire jQuery UI team has either directly or indirectly helped make this book a reality, so Id also like to thank Kris Borchers, Felix Nagel, Corey Frang, Mike Sherov, Rafael Xavier, and Alexander Schmitz.
The people at Manning have been great through the long and arduous process of writing a technical book. My development editor, Sean Dennis, not only provided great feedback throughout, but also took care of managing the various tedious processes involved in writing and publishing a book. Robin de Jongh was the one who asked me to write this book and was a great guy to talk to throughout the process. Without him there would be no book.
The following peer reviewers also provided invaluable insights, reading the manuscript a number of times during its development and Id like to acknowledge them here: Linda Carver, A. Krishna Chaitanya, Alain Couniot, Jrgen De Commer, Dave Corun, Cole Davisson, Mark Elston, Peter Empen, Ed Griebel, Al Scherer, Natalia Stavisky, Philip Taffet, and Gregor Zurowski.
But without question, the lions share of thanks goes to my beautiful and talented significant other, Trish. In addition to providing desperately needed moral support throughout the harrowing journey that was the writing of this book, Trish also helped shape the structure and flow of the chapters with her own development expertise (as well as her brutally honest criticism). And because she has a wizard-like ability to bend CSS to her will, she may even have had her hand in the books examples directly.
Thank you, Trisha. I love you.
About this Book
jQuery UI in Actions primary purpose is to teach you how to use the jQuery UI library to build rich, user-friendly web applications. The book starts with the basics of creating and modifying widgets, and moves on to a series of complex examples, such as building widgets from scratch, optimizing your applications for production, and even building a complete flight-search application.