The DOM and Javascript Toolkits

Kevin Lawver

This is a presentation. If you'd like to view all the slides like a normal web page, you can.

The Document Object Model

A Definition from the W3C

The Document Object Model is a platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure and style of documents. The document can be further processed and the results of that processing can be incorporated back into the presented page. This is an overview of DOM-related materials here at W3C and around the web.
-- W3C DOM Homepage

It's a Standard!

Not Just Javascript

Common Usage

var elm=document.getElementById("content");

Getting All The Lists

var lists=document.getElementsByTagName("ul");

Getting Inside an Element

var cls=list.getAttribute("class");

Setting Attributes

list.setAttribute("class","closed");

Creating Elements

var li=document.createElement("li");
li.appendChild(document.createTextNode("This is the text of the li"));

Appending Elements

list.appendChild(li)

That's the DOM

Problem Number One: Performance

Problem Number Two: Wordy

Solutions

Toolkits

The Ones We Looked At

How to Evaluate Them

Our Problem Statement

Best Practices for Any Toolkit

Why We Chose Dojo

Dojo Packages

dojo.require("dojo.fx.*")

Package Benefits

AJAX and Web IO

The Awesome DOM

Events Are Awesome

Doin' It With Style (the Package)

Ground Effects

Widgets

Dojo's Not Perfect

Things to Keep in Mind: Upgrading

Things to Keep in Mind: Performance

Demos

Questions?