Dojo

Dojo is divided into two parts: dojo.js, and the rest of Dojo Core. Typically, if a function or Class exists within the dojo namespace directly (eg: dojo.require(), dojo.addOnLoad()) it is provided directly by dojo.js. If the function or Class exists beneath the dojo namespace (eg: dojo.dnd.Mover), you will need to require the appropriate module (eg: dojo.require("dojo.dnd.Mover");)

These pages cover both cases, and indicate how they are provided.

Base Dojo: dojo.js

Dojo Base is the functionality you get by just including a stock built dojo.js or dojo.xd.js in your page.

Configuring Dojo

  • djConfig

    Possibility to override certain global settings that control how the framework operates

Array utilities

Details on dojo.every, dojo.filter, dojo.forEach, dojo.indexOf, dojo.lastIndexOf, dojo.map, and dojo.some. See the Array QuickStart for an overview.

  • dojo.forEach

    Invokes a callback function for every item in array

  • dojo.map

    Applies a callback to each element of arr and returns an Array with the results

  • dojo.some

    Iterate over an array, escaping when the callback returns true for some logic check.

  • dojo.every

    Iterate over an array, escaping when the callback returns false for some logic check.

  • dojo.filter

    Iterate over an array, reducing the array based on the callback return.

  • dojo.indexOf

    Find the index of some element in an Array.

  • NodeList array methods

    • NodeList.indexOf, NodeList.lastIndexOf, NodeList.forEach, NodeList.every, NodeList.some, NodeList.concat, NodeList.map, NodeList.filter, NodeList.at

Language Utilities

  • dojo.Deferred

    Communication between threads

  • dojo.hitch

    Function that generates a wrapper function that ensures a function that will only ever execute in a defined scope.

  • dojo.partial

    Function that generates a wrapper function that ensures a function will only ever execute globally.

  • dojo.delegate

    Returns a new object which “looks” to obj for properties which it does not have a value for.

  • dojo.isString

    Checks if the parameter is a String

  • dojo.isArray

    Checks if the parameter is an Array

  • dojo.isFunction

    Checks if the parameter is a Function

  • dojo.isObject

    Checks if the parameter is an Object

  • dojo.isArrayLike

    Checks if the parameter is like an Array

  • dojo.isAlien

    Checks if the parameter is a built-in function

String Utilities

  • dojo.trim

    Trim whitespace from a String

  • dojo.replace

    Simple templates with parameterized substitutions.

DOM

  • dojo.query

    The swiss army knife of DOM node manipulation in Dojo.

  • dojo.NodeList

    A class to handle a list of DOM nodes. Most commonly returned from a dojo.query call.

  • dojo.doc

    Alias for the current document

  • dojo.body

    Return the body element of the document

  • dojo.byId

    Select a DOM node by ‘id’

  • Manipulation

    • dojo.create

      Creates a dom node with optional values and placement

    • dojo.place

      Place DOM nodes relative to others

    • NodeList.place

      Place DOM nodes in list relative to others

    • NodeList.orphan

    • NodeList.adopt

    • NodeList.clone

    • NodeList.addContent

    • dojo.destroy

      Destroy a DOM element

    • dojo.empty

      Empty the contents of a DOM element

    • NodeList.empty

  • Attributes

  • Styles

    • dojo.coords

      Getter for the coordinates (relative to parent and absolute) of a DOM node. Deprecated in Dojo 1.4.

    • NodeList.coords

      Getter for the coordinates of each node in the list. Deprecated in Dojo 1.4.

    • dojo.position

      Getter for the border-box x/y coordinates and size of a DOM node.

    • NodeList.position

      Calls dojo.position for each node in the list and returns those objects as an Array.

    • dojo.style

      A getter/setter for styles on a DOM node

    • dojo.getComputedStyle

      Return a cachable object of all computed styles for a node

    • Class Utilities

    • dojo.marginBox

      Getter/setter for the margin-box of node

    • dojo.contentBox

      Getter/setter for the content-box of node

Effects

Events

Document Lifecycle

Ajax / IO

Package System

JSON Tools

  • dojo.fromJson

    Parses a JSON string to return a JavaScript object

  • dojo.toJson

    Returns a JSON serialization of an object

Objects / OO Tools

Colors

  • dojo._base.Color

    Color object and utility functions to handle colors. Details on

  • dojo.colorFromArray

  • dojo.colorFromHex

  • dojo.colorFromString

  • dojo.colorFromRgb.

Miscellaneous Base

  • dojo.deprecated

    Log a debug message to indicate that a behavior has been deprecated

  • dojo.eval

    Evaluate some string of JavaScript

  • dojo.global

    Alias for the global scope

  • dojo.keys

    A collection of key constants.

  • dojo.locale

    A string containing the current locale as defined by Dojo

  • dojo.setContext

    Changes the behavior of many core Dojo functions that deal with namespace and DOM lookup

  • dojo.version

    The current version number of Dojo

  • dojo.withDoc

    Call callback with documentObject as dojo.doc

  • dojo.withGlobal

    Call callback with globalObject as dojo.global and globalObject.document as dojo.doc

Dojo Core

See also

  • Dijit

    The widget system layered on top of Dojo

  • DojoX

    An area for development of extensions to the Dojo toolkit

Error in the documentation? Can’t find what you are looking for? Let us know!