HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Rough Cuts are manuscripts that are developed but not yet published, available through Safari. Rough Cuts provide you access to the very latest information on a given topic and offer you the opportunity to interact with the author to influence the final publication.
This is a working draft of a pre-release book. It is available before the published date as part of the Rough Cuts service.
Dojo offers Web developers and designers a powerful JavaScript toolkit for rapidly developing robust Ajax applications. Now, for the first time, there’s a complete, example-rich developer’s guide to Dojo and its growing library of prepackaged widgets. Reviewed and endorsed by the Dojo Foundation, the creators of Dojo, this book brings together all the hands-on guidance and tested code samples you need to succeed.
Expert Web developer James E. Harmon begins by demonstrating how to “Ajax-ify” existing applications and pages with Dojo, adding Ajax features such as client- and server-side validation as quickly and nondisruptively as possible. Next, he presents in-depth coverage of Dojo’s user interface, form, layout, and specialized Widgets, showing how they work and how to use them most effectively. Among the Widgets, he covers in detail: Date Pickers, Rich Text Editors, Combo Boxes, Expandable Outlines, and many others.
In conclusion, Harmon introduces the Dojo toolkit’s powerful capabilities for simplifying Ajax development. He thoroughly explains Dojo’s helper functions, shortcuts, and special methods, illuminating each feature with examples of the JavaScript problems it can solve. This section’s far-ranging coverage includes strings, JSON support, event handling, Ajax remoting, Dojo and the DOM, testing, debugging, and much more. All source code examples are provided on a companion Web site, including source code for a complete tutorial case study application.
Foreword xiii
Acknowledgments xv
About the Author xvi
I: A Dojo Tutorial
1 Understanding Dojo: A Tutorial 3
1.1 Introduction to the Tutorial 3
1.1.1 Goals for this Tutorial 4
1.1.2 Goals for Using Dojo 4
1.2 A Standard HTML Data Entry Form 5
1.2.1 First and Last Name 6
1.2.2 User Name 7
1.2.3 Email Address 8
1.2.4 Address 8
1.2.5 State 8
1.2.6 City 10
1.2.7 Zip Code 10
1.2.8 Service Date 11
1.2.9 Comments 11
1.3 The Plan for Enhancing the Form 12
1.3.1 Including Dojo in the Form 12
1.3.2 Adding Client-side Validation 13
1.3.3 Adding Server-side Features 13
1.3.4 Using Additional Specialized Dojo Widgets 13
1.3.5 Processing the Form 14
1.4 Getting and Running the Source Code 14
1.5 Tutorial Step 1–Including Dojo 15
1.5.1 Download or Create the Source Files 15
1.5.2 Include the Code for the Dojo Toolkit 19
1.5.3 Include Dojo Style Sheets 20
1.5.4 Review All the Code Changes 21
1.5.5 Run the New Page 22
2 Using Dojo for Client-side Validation 25
2.1 Validating Form Fields 25
2.2 Tutorial Step 2–Adding Client-side Validation 26