Introduction

Welcome to the Dojo Toolkit: an open-source JavaScript toolkit for building Web applications so dynamic they jump off the page. Filled with special controls such as calendars and menus, and special effects such as wipes and fade-ins, Dojo is gaining popularity rapidly.

Perhaps most important, Dojo is emerging as the toolkit of choice for Ajax applications. Ajax is a set of techniques that allows you to access a Web server from a browser without a page refresh—that is, there’s no blinking and no flicker when you download data behind the scenes with Ajax; you just download the data, and then you can display it in a Web page using dynamic HTML processes. No fuss, no muss—and the end result is an application that looks more like a desktop application than a Web application. With Ajax, the user can do something in a browser page, and the result of the operation appears instantly in the browser window, immediately updating the page without affecting the other contents of the window.

Ajax has often been referred to as the future of Web applications, and Dojo is becoming the way to go when implementing Ajax.

What’s in This Book

Dojo is a JavaScript toolkit, which means that it’s prewritten JavaScript, ready for you to put to work in your own Web pages. In this book, you’ll get a guided tour of the tools that make Dojo so popular.

We start with a look at the controls that come with Dojo, such as clickable calendars and accordion containers that expand and contract at the click of a button. These controls, called Dijits in Dojo, are among Dojo’s most popular features. The Dijits have a polished, professional look and are available for just about any purpose you can think of in Web pages. This book provides a survey of the Dojo Dijits, putting them to work and showing you how they do what they do.

Dojo is known for its drag-and-drop capability, which enables you to drag elements in a Web page to new locations with the mouse and then drop them there. Although you can write this functionality in JavaScript yourself, getting it to work across different browsers and different browser versions is hard—except when you use Dojo.

Dojo is also known for its visual effects, including slick-looking wipes, in which a sheet of color wipes over an element, and fades, in which an element and its background fade from view. You’ll see how to use these kinds of effects in your Web pages.

This book concludes with two chapters on Ajax: one that provides you with basic skills, and one that gets you into truly advanced territory. When you finish this book, you’ll be an expert on using Ajax with Dojo.

That’s the game plan then: to put Dojo to work and see it at its most impressive.

What You’ll Need

You don’t need much to use this book besides a knowledge of HTML, some knowledge of JavaScript, and a Web browser.

In Chapter 1, you’ll see how to install Dojo—and that you don’t even need to install it to use it.

Nearly all the examples in this book can be run from your hard disk simply by opening them in a browser. You should be fairly familiar with basic JavaScript, however. If you’re not, take a look at a good online tutorial before proceeding.

A few Ajax examples make use of PHP on the server, and those examples need to be placed on a Web server that supports the PHP online scripting language. However, you don’t need to know PHP to read this book: those examples only demonstrate how to verify that you can send data to the Web server as well as download it using Ajax; if you don’t have access to a PHP-enabled Web server, you can simply skip those examples.

You can download the examples in this book from www.peachpit.com/dojovqs. To access this supplementary content, you’ll need to register this product. Go to www.peachpit.com/dojovqs. Log in or join Peachpit.com and enter the book’s ISBN (0321605128). After you register, a link to the supplemental content will be listed on your Account page.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.59.50