Mastering Dojo: JavaScript and Ajax Tools for Great Web Experiences


The last couple of years have seen big changes in server-side web programming. Now it's the client's turn; Dojo is the toolkit to make it happen and Mastering Dojo shows you how.

Dojo is a set of client-side JavaScript tools that help you build better web applications. Dojo blurs the line between local, native applications and browser based applications; the browser becomes the user interface platform. "Modern" browsers provide an incomplete, inconvenient, and incompatible ...

See more details below
$28.82 price
(Save 26%)$38.95 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (30) from $1.99   
  • New (10) from $22.15   
  • Used (20) from $1.99   
Sending request ...


The last couple of years have seen big changes in server-side web programming. Now it's the client's turn; Dojo is the toolkit to make it happen and Mastering Dojo shows you how.

Dojo is a set of client-side JavaScript tools that help you build better web applications. Dojo blurs the line between local, native applications and browser based applications; the browser becomes the user interface platform. "Modern" browsers provide an incomplete, inconvenient, and incompatible programming environment, but Dojo eliminates these problems. While there are many JavaScript libraries available, most focus on just one thing (for example, effects libraries, perceived JavaScript omissions, or HTML widgets). Dojo addresses all of these functional areas-and many others-extensively.

In Mastering Dojo, you'll get the whole story, from basic usage to advanced idioms. Mastering Dojo starts out with a fast moving tutorial that will give you techniques that you can start using right away. You'll learn all about Dojo Core—the foundation on which all things Dojo stand. See how you can modularize your project for development and automatically package your release for optimal download performance. You'll also learn how Dojo:

  • augments the core JavaScript library
  • fixes the event system
  • simplifies DOM programming
  • provides a complete class definition facility
  • includes a powerful remote scripting (XHR) framework
  • ... and much more.

You'll love using Dojo's HTML user interface control widget system, Dijit. See how to use over 40 widgets, including the rich yet easy-to-use tree and grid controls.

Finally, you'll get an in-depth look at how to design and build a single-page, richInternet Application.

Read More Show Less

Editorial Reviews

From the Publisher
"Very nice book, it feels so thought through and advanced, really pragmatic and useful stuff ;)"

—Roman Heinrich

"Let me first say that this is the most inspiring software book I have bought in while!"

—Joakim Marner

Read More Show Less

Product Details

  • ISBN-13: 9781934356111
  • Publisher: Pragmatic Programmers, LLC, The
  • Publication date: 6/1/2008
  • Series: Pragmatic Programmers Series
  • Edition number: 1
  • Pages: 558
  • Product dimensions: 7.50 (w) x 8.90 (h) x 1.20 (d)

Meet the Author

Alex Russell studied printed textiles in Manchester, and worked as a designer and teacher before becoming a full-time lecturer in Nottingham. He then set up a freelance business, working from Brussels, Amsterdam and the UK, with an international client list creating print, pattern, forecasting and illustration work for fashion and interiors.

Alex is now a senior lecturer on the Textile Design for Fashion programme at Manchester Metropolitan University and continues to practise as a freelance designer. His work features widely in books on print and pattern, and his research interests include exploring the potential of digital fabric printing and generative design.

Read More Show Less

Table of Contents

1 Introduction 1

1.1 Key Aspects of Dojo 4

1.2 Using the Book 7

1.3 Acknowledgments 9

I Ajax the Dojo Way 11

2 Powerful Web Forms Made Easy 13

2.1 What Customers Are Saying About Your Form 14

2.2 Installing Dojo on Your Own Server 14

2.3 Adding Dojo and Dijit to a Page 15

2.4 Laying Out the Form 19

2.5 Improved Form Controls 24

2.6 Wrapping It Up 27

3 Connecting to Outside Services 31

3.1 Dojo Remote Scripting 31

3.2 JavaScript Idioms for Calling XHR 33

3.3 A Wish List with and dojox.grid.Grid 39

3.4 Researching Cigars Using JSONP 49

3.5 Reviews with dojo.xhrGet 56

3.6 Errors and Debugging 60

II The Dojo APIs 63

4 Dojo In Depth 65

4.1 Modularizing JavaScript 65

4.2 Dojo Source Code Organization 69

4.3 Loading Dojo 72

5 JavaScript Language Extensions 77

5.1 Binding with dojo.hitch 77

5.2 JavaScript 1.6 Array Methods 84

5.3 Support for Polymorphism 88

5.4 Combining, Structuring, and Copying Objects 90

6 Asynchronous Programming 95

6.1 Programming DOM Events with Dojo 95

6.2 Connecting to User-Defined Events with Dojo 111

6.3 Publish-Subscribe 114

6.4 Managing Callbacks with dojo.Deferred 117

7 DOM Utilities 135

7.1 Core Dojo DOM Utility Functions 135

7.2 Finding and Editing Nodes 140

7.3 Inserting, Moving, and Deleting DOM Nodes 153

7.4 Positioning DOM Nodes 156

7.5 Animation 163

8 Remote Scripting with XHR, script, and iframe 173

8.1 Native Remote Scripting 173

8.2 Using the Dojo XHR Framework 175

8.3 Remote Scripting with script 194

8.4 Remote Scripting with iframe 202

8.5 Leveraging Remote Scripting to Access Web Services 206

8.6 Bookmarking and the Back Button Without Navigating 213

9Defining Classes with dojo.declare 221

9.1 Why Use Object-Oriented Programming in JavaScript? 221

9.2 Defining a Simple Class 222

9.3 Defining a Subclass with Single Inheritance 230

9.4 Mixins and Multiple Inheritance 235

9.5 Preprocessing Constructor Arguments 244

9.6 Resolving Property Name Clashes 248

9.7 Two-Phase Construction 251

9.8 Creating Custom Objects Without Constructors 253

10 257

10.1 The Big Picture 258

10.2 and Incremental Search 265

10.3 Partitioning with QueryReadStore 269

10.4 Calling Read Methods from JavaScript 272

10.5 A Yahoo Search Driver 277

11 The Dojo Loader and Build System 283

11.1 The Big Picture 284

11.2 The Dojo Loader 287

11.3 Optimizing Deployment with the Dojo Build System 296

11.4 Compressing JavaScript Resources with Dojo-Rhino 310

III Advanced Dijit 315

12 Scripting Widgets 317

12.1 What Exactly Is a Widget? 317

12.2 Finding and Manipulating Declarative Widgets 320

12.3 Creating Instances Programmatically 325

12.4 Extension Points 329

12.5 Example: Live Forms 336

13 Tree 339

13.1 A Simple Tree 339

13.2 Hierarchical Data Stores 342

13.3 Extension Points 347

13.4 Manipulating the Tree 349

13.5 Drag and Drop 354

14 Grid 365

14.1 Grid Display and Design 366

14.2 Programmatic Structures 371

14.3 Extension Points 374

14.4 Cell Editing 384

14.5 Grid Manipulation 388

15 Form Controls 393

15.1 Form Control Features 393

15.2 Streamlined Editing 396

15.3 Feedback 404

15.4 Dates, Numbers, and i18n 408

15.5 Action Buttons, Toolbars, and Menus 417

15.6 Ally 420

16 Dijit Themes, Design, and Layout 427

16.1 Theme Structure 427

16.2 Changing Look and Feel 434

16.3 Ally and Themes 439

16.4 Panes: ContentPane and TitlePane 441

16.5 The Alignment Container: BorderContainer 446

16.6 Stack Containers 450

17 Creating and Extending Widget Classes 455

17.1 Widget Classes Using dijit.Declaration 456

17.2 Widget Classes Using dojo.declare 461

17.3 The Widget Life Cycle 466

17.4 Extending Widgets 469

17.5 Example: A Yahoo Answers Widget 470

IV Rich Internet Applications 477

18 Building a Rich Internet Application 479

18.1 The Big Picture 479

18.2 Step 1: Create the Application Skeleton 488

18.3 Step 2: The Main Menu and Command System 493

18.4 Step 3: A Custom Statusbar Widget 501

19 Adding Dynamic Content to an RIA 507

19.1 Step 4: The Navigator Pane and On-Demand Data Store 507

19.2 Step 5: Workspace Objects 517

20 Going Forward 531

20.1 Foundations 531

20.2 Graphics 533

20.3 Dojo Data and Storage 534

V Appendixes 535

A Bibliography 537

Index 539

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Reviews
  • Posted November 9, 2009

    more from this reviewer

    Not a book for someone new to JavaScript!

    This book seems to be written for people who are already comfortable with JavaScript.

    The organization of this book seems backwards. Most educational works teach you to crawl, then walk, run, and then soar. This one starts by covering some of the more in-depth and arcane workings of the toolkit before covering the basics of how to put together a basic Web page using the toolkit. Several examples: Chapter 16, "Dijit Themes, Design, and Layout" covers many of the tools needed to create even the most basic Web page should probably be Chapter 3 or 4; Chapter 3, "Connecting to Outside Services", covers AJAX tools and constructs, should probably be Chapter 15 or 16; and Chapter 11, "The Dojo Loader and Build System" covers topics that, by its own admission, you aren't required to use in your own code and probably should have been relegated to an appendix.

    The work is very complete, but many - too many - of the examples don't work. Code is available for download at the related Web site, but it, too, is rife with errors.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)