dojo (version 1.5)

Object » dojo
<script src="path/to/dojo.js"></script>

Property Summary

Method Summary

  • dojo.__backArgs(kwArgs)
  • dojo._abs()
  • dojo._callLoaded()
  • dojo._connect(obj, event, context, method, dontFix) returns Handle
  • dojo._defaultEasing(n) The default easing function for dojo.Animation(s)
  • dojo._destroyElement(node) Existing alias for dojo.destroy. Deprecated, will be removed in 2.0
  • dojo._disconnect(obj, event, handle, listener)
  • dojo._docScroll()
  • dojo._escapeString(str) Adds escape sequences for non-visual characters, double quote and backslash and surrounds with double quotes to form a valid string literal.
  • dojo._fade(args) returns dojo.Animation Returns an animation that will fade the node defined by args.node from the start to end values passed (args.start args.end) (end is mandatory, start is optional)
  • dojo._filterQueryResult(nodeList, simpleFilter)
  • dojo._fixIeBiDiScrollLeft(scrollLeft) returns Integer
  • dojo._getBorderBox(node, computedStyle)
  • dojo._getBorderExtents(n, computedStyle) returns an object with properties useful for noting the border dimensions.
  • dojo._getContentBox(node, computedStyle) Returns an object that encodes the width, height, left and top positions of the node's content box, irrespective of the current box model.
  • dojo._getIeDispatcher() returns function
  • dojo._getIeDocumentElementOffset() returns the offset in x and y from the document body to the visual edge of the page
  • dojo._getMarginBox(node, computedStyle) returns an object that encodes the width, height, left and top positions of the node's margin box.
  • dojo._getMarginExtents(n, computedStyle) returns object with properties useful for box fitting with regards to box margins (i.e., the outer-box). * l/t = marginLeft, marginTop, respectively * w = total width, margin inclusive * h = total height, margin inclusive The w/h are used for calculating boxes. Normally application code will not need to invoke this directly, and will use the ...box... functions instead.
  • dojo._getModulePrefix(module) returns String gets the prefix associated with module
  • dojo._getModuleSymbols(modulename) returns Array Converts a module name in dotted JS notation to an array representing the path in the source tree
  • dojo._getOpacity(node) returns Number Returns the current opacity of the passed node as a floating-point value between 0 and 1.
  • dojo._getPadBorderExtents(n, computedStyle) Returns object with properties useful for box fitting with regards to padding.
  • dojo._getPadExtents(n, computedStyle) Returns object with special values specifically useful for node fitting.
  • dojo._getProp(parts, create, context) returns mixed
  • dojo._getText(uri, fail_ok) returns null|String Read the contents of the specified uri and return those contents.
  • dojo._hitchArgs(scope, method) returns mixed
  • dojo._ieDispatcher(args, sender)
  • dojo._inContext(g, d, f)
  • dojo._ioAddQueryToUrl(ioArgs) Adds query params discovered by the io deferred construction to the URL. Only use this for operations which are fundamentally GET-type operations.
  • dojo._ioCancelAll() Cancels all pending IO requests, regardless of IO type (xhr, script, iframe).
  • dojo._ioNotifyStart(dfd) If dojo.publish is available, publish topics about the start of a request queue and/or the the beginning of request.
  • dojo._ioSetArgs(args, canceller, okHandler, errHandler) sets up the Deferred and ioArgs property on the Deferred so it can be used in an io call.
  • dojo._ioWatch(dfd, validCheck, ioCheck, resHandle) Watches the io request represented by dfd to see if it completes.
  • dojo._isBodyLtr()
  • dojo._isButtonTag(node) True if the node is BUTTON or INPUT.type="button".
  • dojo._isDocumentOk(http) returns Boolean
  • dojo._isLocalUrl(uri) determines if URI is local or not.
  • dojo._loadInit(e)
  • dojo._loadModule()
  • dojo._loadPath(relpath, module, cb) returns Boolean Internal xd loader function. Overrides loadPath() from loader.js. xd loading requires slightly different behavior from loadPath().
  • dojo._loadUri(uri, cb, currentIsXDomain, module) returns Boolean|Boolean: contents? true : false Internal xd loader function. Overrides loadUri() from loader.js. xd loading requires slightly different behavior from loadPath().
  • dojo._loadUriAndCheck(uri, moduleName, cb) returns Boolean calls loadUri then findModule and returns true if both succeed
  • dojo._mixin(target, source) returns Object Adds all properties and methods of source to target. This addition is "prototype extension safe", so that instances of objects will not pass along prototype defaults.
  • dojo._moduleHasPrefix(module) returns Boolean checks to see if module has been established
  • dojo._modulesLoaded()
  • dojo._setBox(node, l, t, w, h, u) sets width/height/left/top in the current (native) box-model dimentions. Uses the unit passed in u.
  • dojo._setContentSize(node, widthPx, heightPx, computedStyle) Sets the size of the node's contents, irrespective of margins, padding, or borders.
  • dojo._setMarginBox(node, leftPx, topPx, widthPx, heightPx, computedStyle) sets the size of the node's margin box and placement (left/top), irrespective of box model. Think of it as a passthrough to dojo._setBox that handles box-model vagaries for you.
  • dojo._setOpacity(node, opacity) returns Number set the opacity of the passed node portably. Returns the new opacity of the node.
  • dojo._spidermonkeyCurrentFile(depth)
  • dojo._toArray(obj, offset, startWith) Converts an array-like object (i.e. arguments, DOMCollection) to an array. Returns a new Array with the elements of obj.
  • dojo._toDom(frag, doc) returns DOMNode converts HTML string into DOM nodes.
  • dojo._toPixelValue(element, value, avalue)
  • dojo._usesBorderBox(node) returns boolean True if the node uses border-box layout.
  • dojo._xdClearInterval() Internal xd loader function. Clears the interval timer used to check on the status of in-flight xd module resource requests.
  • dojo._xdCreateResource(contents, resourceName, resourcePath) returns String Internal xd loader function. Creates an xd module source given an non-xd module contents.
  • dojo._xdDebugFileLoaded(resourceName)
  • dojo._xdEvalReqs(reqChain) Internal xd loader function. Does a depth first, breadth second search and eval of required modules.
  • dojo._xdExtractLoadInits(fileContents)
  • dojo._xdInitExtraLocales()
  • dojo._xdIsXDomainPath(relpath) Figure out whether the path is local or x-domain If there is a colon before the first / then, we have a URL with a protocol.
  • dojo._xdLoadFlattenedBundle(moduleName, bundleName, locale, bundleData) Internal xd loader function. Used when loading a flattened localized bundle via a script tag.
  • dojo._xdNotifyLoaded()
  • dojo._xdReset() Internal xd loader function. Resets the xd state.
  • dojo._xdResourceLoaded(res) Internal xd loader function. Called by an xd module resource when it has been loaded via a script tag.
  • dojo._xdUnpackDependency(dep) returns Object Internal xd loader function. Determines what to do with a dependency that was listed in an xd version of a module contents.
  • dojo._xdWalkReqs() Internal xd loader function. Walks the requires and evaluates module resource contents in the right order.
  • dojo._xdWatchInFlight() Internal xd loader function. Monitors in-flight requests for xd module resources.
  • dojo._xhrObj(args)
  • dojo.addClass(node, classStr) Adds the specified classes to the end of the class list on the passed node. Will not re-apply duplicate classes.
  • dojo.addOnLoad(obj, functionName) Registers a function to be triggered after the DOM and dojo.require() calls have finished loading.
  • dojo.addOnWindowUnload(obj, functionName) registers a function to be triggered when window.onunload fires. Be careful trying to modify the DOM or access JavaScript properties during this phase of page unloading: they may not always be available. Consider dojo.addOnUnload() if you need to modify the DOM or do heavy JavaScript work.
  • dojo.anim(node, properties, duration, easing, onEnd, delay) returns dojo.Animation A simpler interface to dojo.animateProperty(), also returns an instance of dojo.Animation but begins the animation immediately, unlike nearly every other Dojo animation API.
  • dojo.animateProperty(args) returns dojo.Animation An extension of dojo.animateProperty which adds functionality that animates a "complex property". The primary example is the clip style: rect(10px 30px 10px 50px). Note this can also be used with (and is actually intended for) CSS3 properties, such as transform: transform: rotate(10deg) translateX(0px)
  • dojo.attr(node, name, value) returns DomNode|Anything Gets or sets an attribute on an HTML element.
  • dojo.blendColors(start, end, weight, obj) returns dojo.Color Blend colors end and start with weight from 0 to 1, 0.5 being a 50/50 blend, can reuse a previously allocated dojo.Color object for the result
  • dojo.body() returns Node Return the body element of the document return the body object associated with dojo.doc
  • dojo.byId(id, doc) returns assume it's a node|DomNode Returns DOM node with matching id attribute or null if not found. If id is a DomNode, this function is a no-op.
  • dojo.clone(o) returns anything|Node|Date|Object Clones objects (including DOM nodes) and all children. Warning: do not clone cyclic structures.
  • dojo.colorFromArray(a, obj) returns dojo.Color Builds a dojo.Color from a 3 or 4 element array, mapping each element in sequence to the rgb(a) values of the color.
  • dojo.colorFromHex(color, obj) returns dojo.Color Converts a hex string with a '#' prefix to a color object. Supports 12-bit #rgb shorthand. Optionally accepts a dojo.Color object to update with the parsed value.
  • dojo.colorFromRgb(color, obj) returns dojo.Color get rgb(a) array from css-style color declarations
  • dojo.colorFromString(str, obj) Parses str for a color value. Accepts hex, rgb, and rgba style color values.
  • dojo.connect(obj, event, context, method, dontFix) dojo.connect is the core event handling and delegation method in Dojo. It allows one function to "listen in" on the execution of any other, triggering the second whenever the first is called. Many listeners may be attached to a function, and source functions may be either regular function calls or DOM events.
  • dojo.connectPublisher(topic, obj, event) returns Handle Ensure that every time obj.event() is called, a message is published on the topic. Returns a handle which can be passed to dojo.disconnect() to disable subsequent automatic publication on the topic.
  • dojo.contentBox(node, box) returns Object Getter/setter for the content-box of node.
  • dojo.coords(node, includeScroll) Deprecated: Use position() for border-box x/y/w/h or marginBox() for margin-box w/h/l/t. Returns an object representing a node's size and position.
  • dojo.create(tag, attrs, refNode, pos) returns DomNode Create an element, allowing for optional attribute decoration and placement.
  • dojo.declare(className, superclass, props) returns Function Create a feature-rich constructor from compact notation.
  • dojo.delegate(obj, props) Returns a new object which "looks" to obj for properties which it does not have a value for. Optionally takes a bag of properties to seed the returned object with initially.
  • dojo.deprecated(behaviour, extra, removal) Log a debug message to indicate that a behavior has been deprecated.
  • dojo.destroy(node) Removes a node from its parent, clobbering it and all of its children.
  • dojo.disconnect(handle) Remove a link created by dojo.connect.
  • dojo.empty(node) safely removes all children of the node.
  • dojo.eval(scriptFragment) returns Object A legacy method created for use exclusively by internal Dojo methods. Do not use this method directly, the behavior of this eval will differ from the normal browser eval.
  • dojo.every(arr, callback, thisObject) returns Boolean Determines whether or not every item in arr satisfies the condition implemented by callback.
  • dojo.exists(name, obj) returns Boolean determine if an object supports a given method
  • dojo.exit(exitcode)
  • dojo.experimental(moduleName, extra) Marks code as experimental.
  • dojo.extend(constructor, props) returns Object Adds all properties and methods of props to constructor's prototype, making them available to all instances created with constructor.
  • dojo.fadeIn(args) returns dojo.Animation Returns an animation that will fade node defined in 'args' from its current opacity to fully opaque.
  • dojo.fadeOut(args) returns dojo.Animation Returns an animation that will fade node defined in 'args' from its current opacity to fully transparent.
  • dojo.fieldToObject(inputNode) returns Object Serialize a form field to a JavaScript object.
  • dojo.filter(arr, callback, thisObject) returns Array Returns a new Array with those items from arr that match the condition implemented by callback.
  • dojo.fixEvent(evt, sender) normalizes properties on the event object including event bubbling methods, keystroke normalization, and x/y positions
  • dojo.forEach(arr, callback, thisObject) for every item in arr, callback is invoked. Return values are ignored. If you want to break out of the loop, consider using dojo.every() or dojo.some(). forEach does not allow breaking out of the loop over the items in arr.
  • dojo.formToJson(formNode, prettyPrint) returns String Create a serialized JSON string from a form node or string ID identifying the form to serialize
  • dojo.formToObject(formNode) returns Object Serialize a form node to a JavaScript object.
  • dojo.formToQuery(formNode) returns String Returns a URL-encoded string representing the form passed as either a node or string ID identifying the form to serialize
  • dojo.fromJson(json) returns Object Parses a [JSON](http://json.org) string to return a JavaScript object.
  • dojo.getComputedStyle(node) returns CSS2Properties Returns a "computed style" object.
  • dojo.getNodeProp(node, name) returns Anything Returns an effective value of a property or an attribute.
  • dojo.getObject(name, create, context) returns Object Get a property from a dot-separated string, such as "A.B.C"
  • dojo.hasAttr(node, name) returns Boolean Returns true if the requested attribute is specified on the given element, and false otherwise.
  • dojo.hasClass(node, classStr) returns Boolean Returns whether or not the specified classes are a portion of the class list currently applied to the node.
  • dojo.hash(hash, replace) returns String Gets or sets the hash string.
  • dojo.hitch(scope, method) returns Function Returns a function that will only ever execute in the a given scope. This allows for easy use of object member functions in callbacks and other places in which the "this" keyword may otherwise not reference the expected scope. Any number of default positional arguments may be passed as parameters beyond "method". Each of these values will be used to "placehold" (similar to curry) for the hitched function.
  • dojo.indexOf(array, value, fromIndex, findLast) returns Number locates the first index of the provided value in the passed array. If the value is not found, -1 is returned.
  • dojo.isAlien(it) returns Boolean Returns true if it is a built-in function or some other kind of oddball that *should* report as a function but doesn't
  • dojo.isArray(it) returns Boolean Return true if it is an Array. Does not work on Arrays created in other windows.
  • dojo.isArrayLike(it) returns Boolean similar to dojo.isArray() but more permissive
  • dojo.isCopyKey(e) returns Boolean Checks an event for the copy key (meta on Mac, and ctrl anywhere else)
  • dojo.isDescendant(node, ancestor) returns Boolean Returns true if node is a descendant of ancestor
  • dojo.isFunction(it) Return true if it is a Function
  • dojo.isObject(it) Returns true if it is a JavaScript object (or an Array, a Function or null)
  • dojo.isString(it) returns Boolean Return true if it is a String
  • dojo.lastIndexOf(array, value, fromIndex) returns Number locates the last index of the provided value in the passed array. If the value is not found, -1 is returned.
  • dojo.loadInit(init) Executes a function that needs to be executed for the loader's dojo.requireIf resolutions to work. This is needed mostly for the xdomain loader case where a function needs to be executed to set up the possible values for a dojo.requireIf call.
  • dojo.loaded() signal fired when initial environment and package loading is complete. You should use dojo.addOnLoad() instead of doing a direct dojo.connect() to this method in order to handle initialization tasks that require the environment to be initialized. In a browser host, declarative widgets will be constructed when this function finishes runing.
  • dojo.map(arr, callback, thisObject) returns Array applies callback to each element of arr and returns an Array with the results
  • dojo.marginBox(node, box) returns Object Getter/setter for the margin-box of node.
  • dojo.mixin(obj, props) returns Object Adds all properties and methods of props to obj and returns the (now modified) obj.
  • dojo.moduleUrl(module, url) returns dojo._Url Returns a dojo._Url object relative to a module.
  • dojo.objectToQuery(map) returns String takes a name/value mapping object and returns a string representing a URL-encoded version of that object.
  • dojo.partial(method) returns Function similar to hitch() except that the scope object is left to be whatever the execution context eventually becomes.
  • dojo.place(node, refNode, position) returns DomNode Attempt to insert node into the DOM, choosing from various positioning options. Returns the first argument resolved to a DOM node.
  • dojo.platformRequire(modMap) require one or more modules based on which host environment Dojo is currently operating in
  • dojo.popContext() If the context stack contains elements, ensure that subsequent code executes in the *previous* context to the current context. The current context set ([global, document]) is returned.
  • dojo.position(node, includeScroll) returns Object Gets the position and size of the passed element relative to the viewport (if includeScroll==false), or relative to the document root (if includeScroll==true).
  • dojo.provide(resourceName) returns Object Register a resource with the package system. Works in conjunction with dojo.require
  • dojo.pushContext(g, d) returns Array causes subsequent calls to Dojo methods to assume the passed object and, optionally, document as the default scopes to use. A 2-element array of the previous global and document are returned.
  • dojo.queryToObject(str) returns Object Create an object representing a de-serialized query section of a URL. Query keys with multiple values are returned in an array.
  • dojo.rawXhrPost()
  • dojo.rawXhrPut()
  • dojo.ready()
  • dojo.registerModulePath(module, prefix) Maps a module name to a path
  • dojo.removeAttr(node, name) Removes an attribute from an HTML element.
  • dojo.removeClass(node, classStr) Removes the specified classes from node. No dojo.hasClass check is required.
  • dojo.replace(tmpl, map, pattern) returns String Performs parameterized substitutions on a string. Throws an exception if any parameter is unmatched.
  • dojo.require(moduleName, omitModuleCheck) loads a Javascript module from the appropriate URI
  • dojo.requireIf(condition, resourceName) If the condition is true then call dojo.require() for the specified resource
  • dojo.requireLocalization(moduleName, bundleName, locale, availableFlatLocales) loads a bundle intelligently based on whether the module is local or xd. Overrides the local-case implementation.
  • dojo.safeMixin(target, source) Mix in properties skipping a constructor and decorating functions like it is done by dojo.declare.
  • dojo.setContext(globalObject, globalDocument) changes the behavior of many core Dojo functions that deal with namespace and DOM lookup, changing them to work in a new global context (e.g., an iframe). The varibles dojo.global and dojo.doc are modified as a result of calling this function and the result of dojo.body() likewise differs.
  • dojo.setObject(name, value, context) returns Object Set a property from a dot-separated string, such as "A.B.C"
  • dojo.setSelectable(node, selectable) Enable or disable selection on a node
  • dojo.some(arr, callback, thisObject) returns Boolean Determines whether or not any item in arr satisfies the condition implemented by callback.
  • dojo.stopEvent(evt) prevents propagation and clobbers the default action of the passed event
  • dojo.style(node, style, value) Accesses styles on a node. If 2 arguments are passed, acts as a getter. If 3 arguments are passed, acts as a setter.
  • dojo.toJson(it, prettyPrint, _indentStr) returns null|String Returns a [JSON](http://json.org) serialization of an object.
  • dojo.toggleClass(node, classStr, condition) Adds a class to node if not present, or removes if present. Pass a boolean condition if you want to explicitly add or remove.
  • dojo.trim(str) returns String Trims whitespace from both sides of the string
  • dojo.unloaded() signal fired by impending environment destruction. You should use dojo.addOnUnload() instead of doing a direct dojo.connect() to this method to perform page/application cleanup methods. See dojo.addOnUnload for more info.
  • dojo.when(promiseOrValue, callback, errback, progressHandler) This provides normalization between normal synchronous values and asynchronous promises, so you can interact with them in a common way
  • dojo.windowUnloaded() signal fired by impending window destruction. You may use dojo.addOnWIndowUnload() or dojo.connect() to this method to perform page/application cleanup methods. See dojo.addOnWindowUnload for more info.
  • dojo.withDoc(documentObject, callback, thisObject, cbArguments) Invoke callback with documentObject as dojo.doc.
  • dojo.withGlobal(globalObject, callback, thisObject, cbArguments) Invoke callback with globalObject as dojo.global and globalObject.document as dojo.doc.
  • dojo.xdRequireLocalization(m, b, locale, fLocales, moduleName, bundleName, availableFlatLocales) Internal xd loader function. The xd version of dojo.requireLocalization.
  • dojo.xhr(method, args, hasBody) returns dojo.Deferred Sends an HTTP request with the given method.
  • dojo.xhrDelete(args) returns dojo.Deferred Sends an HTTP DELETE request to the server.
  • dojo.xhrGet(args) returns dojo.Deferred Sends an HTTP GET request to the server.
  • dojo.xhrPost(args) returns dojo.Deferred Sends an HTTP POST request to the server. In addtion to the properties listed for the dojo.__XhrArgs type, the following property is allowed: postData: String. Send raw data in the body of the POST request.
  • dojo.xhrPut(args) returns dojo.Deferred Sends an HTTP PUT request to the server. In addtion to the properties listed for the dojo.__XhrArgs type, the following property is allowed: putData: String. Send raw data in the body of the PUT request.

Event Summary

Attached Objects

Properties

dojo.NodeList-fx
Defined by dojo
Adds dojo.fx animation support to dojo.query()
dojo.NodeList-html
Defined by dojo
Adds a chainable html method to dojo.query() / Nodelist instances for setting/replacing node content
dojo.NodeList-manipulate
Defined by dojo
Adds a chainable methods to dojo.query() / Nodelist instances for manipulating HTML and DOM nodes and their properties.
dojo.NodeList-traverse
Defined by dojo
Adds a chainable methods to dojo.query() / Nodelist instances for traversing the DOM
dojo._Animation
Defined by dojo
dojo._NodeListCtor
Defined by dojo
dojo._blockAsync
Defined by dojo
dojo._bodyLtr
Defined by dojo
dojo._defaultContext
Defined by dojo
dojo._defaultXhr
Defined by dojo
dojo._delegate
Defined by dojo
dojo._global_omit_module_check
Defined by dojo
dojo._hasResource
Defined by dojo
dojo._headElement
Defined by dojo
dojo._ieListenersName
Defined by dojo
dojo._inFlightCount
Defined by dojo
dojo._initFired
Defined by dojo
dojo._isXDomain
Defined by dojo
dojo._loadNotifying
Defined by dojo
dojo._loadedModules
Defined by dojo
dojo._loadedUrls
Defined by dojo
dojo._loaders
Defined by dojo
dojo._name
Defined by dojo
dojo._oldConnect
Defined by dojo
dojo._postLoad
Defined by dojo
dojo._scopeArgs
Defined by dojo
dojo._scopeMap
Defined by dojo
dojo._scopeMapRev
Defined by dojo
dojo._scopeName
Defined by dojo
dojo._scopePrefix
Defined by dojo
dojo._scopePrefixArgs
Defined by dojo
dojo._scopeSuffix
Defined by dojo
dojo._scrollIntervalId
Defined by dojo
dojo._timeouts
Defined by dojo
dojo._topics
Defined by dojo
dojo._unloaders
Defined by dojo
dojo._windowUnloaders
Defined by dojo
dojo._xdBundleMap
Defined by dojo
dojo._xdCharSet
Defined by dojo
dojo._xdContents
Defined by dojo
dojo._xdDebugScopeChecked
Defined by dojo
dojo._xdDepMap
Defined by dojo
dojo._xdInFlight
Defined by dojo
dojo._xdOrderedReqs
Defined by dojo
dojo._xdRealRequireLocalization
Defined by dojo
dojo._xdReqLoc
Defined by dojo
dojo._xdStartTime
Defined by dojo
dojo._xdTimer
Defined by dojo
dojo.baseUrl
Defined by dojo
The root relative path to dojo.js (as a string)
dojo.boxModel
Defined by dojo
dojo.isBrowser
Defined by dojo
True if the client is a web-browser
dojo.isChrome
Defined by dojo
| undefined Version as a Number if client is Chrome browser. undefined otherwise. isMac: Boolean True if the client runs on Mac
dojo.isFF
Defined by dojo
| undefined Version as a Number if client is FireFox. undefined otherwise. Corresponds to major detected FireFox version (1.5, 2, 3, etc.)
dojo.isIE
Defined by dojo
| undefined Version as a Number if client is MSIE(PC). undefined otherwise. Corresponds to major detected IE version (6, 7, 8, etc.)
dojo.isKhtml
Defined by dojo
| undefined Version as a Number if client is a KHTML browser. undefined otherwise. Corresponds to major detected version.
dojo.isMoz
Defined by dojo
dojo.isMozilla
Defined by dojo
| undefined Version as a Number if client is a Mozilla-based browser (Firefox, SeaMonkey). undefined otherwise. Corresponds to major detected version.
dojo.isOpera
Defined by dojo
| undefined Version as a Number if client is Opera. undefined otherwise. Corresponds to major detected version.
dojo.isQuirks
Defined by dojo
dojo.isRhino
Defined by dojo
dojo.isSafari
Defined by dojo
| undefined Version as a Number if client is Safari or iPhone. undefined otherwise.
dojo.isSpidermonkey
Defined by dojo
Detect spidermonkey
dojo.isWebKit
Defined by dojo
| undefined Version as a Number if client is a WebKit-derived browser (Konqueror, Safari, Chrome, etc.). undefined otherwise.
dojo.jaxer
Defined by dojo
dojo.locale
Defined by dojo
the locale as defined by Dojo (read-only)
dojo.nonDebugProvide
Defined by dojo
dojo.publish
Defined by dojo
dojo.requireAfterIf
Defined by dojo
dojo.robot
Defined by dojo
dojo.robotx
Defined by dojo
dojo.subscribe
Defined by dojo
dojo.tests
Defined by dojo
D.O.H. Test files for Dojo unit testing.
dojo.toJsonIndentStr
Defined by dojo
dojo.uacss
Defined by dojo
dojo.unsubscribe
Defined by dojo

Methods

dojo.__backArgs
Defined by dojo
ParameterTypeDescription
kwArgs
dojo._abs
Defined by dojo
dojo._callLoaded
Defined by dojo
dojo._connect
Defined by dojo
Returns Handle
ParameterTypeDescription
obj
event
context
method
dontFix
dojo._defaultEasing
Defined by dojo
The default easing function for dojo.Animation(s)
ParameterTypeDescription
nDecimal
Optional.
dojo._destroyElement
Defined by dojo
Existing alias for dojo.destroy. Deprecated, will be removed in 2.0
ParameterTypeDescription
node
dojo._disconnect
Defined by dojo
ParameterTypeDescription
obj
event
handle
listener
dojo._docScroll
Defined by dojo
dojo._escapeString
Defined by dojo
Adds escape sequences for non-visual characters, double quote and backslash and surrounds with double quotes to form a valid string literal.
ParameterTypeDescription
strString
dojo._fade
Defined by dojo
Returns dojo.Animation
Returns an animation that will fade the node defined by args.node from the start to end values passed (args.start args.end) (end is mandatory, start is optional)
ParameterTypeDescription
argsObject
dojo._filterQueryResult
Defined by dojo
ParameterTypeDescription
nodeList
simpleFilter
dojo._fixIeBiDiScrollLeft
Defined by dojo
Returns Integer
ParameterTypeDescription
scrollLeftInteger
dojo._getBorderBox
Defined by dojo
ParameterTypeDescription
node
computedStyle
dojo._getBorderExtents
Defined by dojo
  • l/t = the sum of left/top border (respectively)
  • w = the sum of the left and right border
  • h = the sum of the top and bottom border The w/h are used for calculating boxes. Normally application code will not need to invoke this directly, and will use the ...box... functions instead.
ParameterTypeDescription
nDomNode
computedStyleObject
dojo._getContentBox
Defined by dojo
Returns an object that encodes the width, height, left and top positions of the node's content box, irrespective of the current box model.
ParameterTypeDescription
node
computedStyle
dojo._getIeDispatcher
Defined by dojo
Returns function
dojo._getIeDocumentElementOffset
Defined by dojo

The following values in IE contain an offset: event.clientX event.clientY node.getBoundingClientRect().left node.getBoundingClientRect().top But other position related values do not contain this offset, such as node.offsetLeft, node.offsetTop, node.style.left and node.style.top. The offset is always (2, 2) in LTR direction. When the body is in RTL direction, the offset counts the width of left scroll bar's width. This function computes the actual offset.

dojo._getMarginBox
Defined by dojo
returns an object that encodes the width, height, left and top positions of the node's margin box.
ParameterTypeDescription
nodeDomNode
computedStyleObject
dojo._getMarginExtents
Defined by dojo
returns object with properties useful for box fitting with regards to box margins (i.e., the outer-box). * l/t = marginLeft, marginTop, respectively * w = total width, margin inclusive * h = total height, margin inclusive The w/h are used for calculating boxes. Normally application code will not need to invoke this directly, and will use the ...box... functions instead.
ParameterTypeDescription
n
computedStyle
dojo._getModulePrefix
Defined by dojo
Returns String
gets the prefix associated with module
ParameterTypeDescription
moduleString
dojo._getModuleSymbols
Defined by dojo
Returns Array
Converts a module name in dotted JS notation to an array representing the path in the source tree
ParameterTypeDescription
modulenameString
dojo._getOpacity
Defined by dojo
Returns Number: Number between 0 and 1
Returns the current opacity of the passed node as a floating-point value between 0 and 1.
ParameterTypeDescription
nodeDomNodea reference to a DOM node. Does NOT support taking an ID string for speed reasons.
dojo._getPadBorderExtents
Defined by dojo
  • l/t = the sum of left/top padding and left/top border (respectively)
  • w = the sum of the left and right padding and border
  • h = the sum of the top and bottom padding and border The w/h are used for calculating boxes. Normally application code will not need to invoke this directly, and will use the ...box... functions instead.
ParameterTypeDescription
nDomNode
computedStyleObject
dojo._getPadExtents
Defined by dojo

Returns an object with w, h, l, t properties: l/t = left/top padding (respectively) w = the total of the left and right padding h = the total of the top and bottom padding If 'node' has position, l/t forms the origin for child nodes. The w/h are used for calculating boxes. Normally application code will not need to invoke this directly, and will use the ...box... functions instead.

ParameterTypeDescription
nDomNode
computedStyleObject
dojo._getProp
Defined by dojo
Returns mixed
ParameterTypeDescription
partsArray
createBoolean
contextObject
dojo._getText
Defined by dojo
Returns null|String: The response text. null is returned when there is a failure and failure is okay (an exception otherwise)
Read the contents of the specified uri and return those contents.
ParameterTypeDescription
uriURIA relative or absolute uri.
fail_okBooleanDefault false. If fail_ok and loading fails, return null instead of throwing.
dojo._hitchArgs
Defined by dojo
Returns mixed
ParameterTypeDescription
scope
method,
One or more can be passed.
dojo._ieDispatcher
Defined by dojo
ParameterTypeDescription
args
sender
dojo._inContext
Defined by dojo
ParameterTypeDescription
g
d
f
dojo._ioAddQueryToUrl
Defined by dojo
Adds query params discovered by the io deferred construction to the URL. Only use this for operations which are fundamentally GET-type operations.
ParameterTypeDescription
ioArgsdojo.__IoCallbackArgs
ParameterTypeDescription
argsObject

the original object argument to the IO call.

xhrXMLHttpRequest

For XMLHttpRequest calls only, the XMLHttpRequest object that was used for the request.

urlString

The final URL used for the call. Many times it will be different than the original args.url value.

queryString

For non-GET requests, the name1=value1&name2=value2 parameters sent up in the request.

handleAsString

The final indicator on how the response will be handled.

idString

For dojo.io.script calls only, the internal script ID used for the request.

canDeleteBoolean

For dojo.io.script calls only, indicates whether the script tag that represents the request can be deleted after callbacks have been called. Used internally to know when cleanup can happen on JSONP-type requests.

jsonObject

For dojo.io.script calls only: holds the JSON response for JSONP-type requests. Used internally to hold on to the JSON responses. You should not need to access it directly -- the same object should be passed to the success callbacks directly.

dojo._ioCancelAll
Defined by dojo
Cancels all pending IO requests, regardless of IO type (xhr, script, iframe).
dojo._ioNotifyStart
Defined by dojo

Used by IO transports. An IO transport should call this method before making the network connection.

ParameterTypeDescription
dfdDeferred
dojo._ioSetArgs
Defined by dojo
sets up the Deferred and ioArgs property on the Deferred so it can be used in an io call.
ParameterTypeDescription
argsdojo.__IoArgsThe args object passed into the public io call. Recognized properties on the args object are:
ParameterTypeDescription
urlString

URL to server endpoint.

contentObject

Contains properties with string values. These properties will be serialized as name1=value2 and passed in the request.

timeoutInteger

Milliseconds to wait for the response. If this time passes, the then error callbacks are called.

formDOMNode

DOM node for a form. Used to extract the form values and send to the server.

preventCacheBoolean

Default is false. If true, then a "dojo.preventCache" parameter is sent in the request with a value that changes with each request (timestamp). Useful only with GET-type requests.

handleAsString

Acceptable values depend on the type of IO transport (see specific IO calls for more information). rawBody: String? Sets the raw body for an HTTP request. If this is used, then the content property is ignored. This is mostly useful for HTTP methods that have a body to their requests, like PUT or POST. This property can be used instead of postData and putData for dojo.rawXhrPost and dojo.rawXhrPut respectively.

ioPublishBoolean

Set this explicitly to false to prevent publishing of topics related to IO operations. Otherwise, if djConfig.ioPublish is set to true, topics will be published via dojo.publish for different phases of an IO operation. See dojo.__IoPublish for a list of topics that are published.

cancellerFunctionThe canceller function used for the Deferred object. The function will receive one argument, the Deferred object that is related to the canceller.
okHandlerFunctionThe first OK callback to be registered with Deferred. It has the opportunity to transform the OK response. It will receive one argument -- the Deferred object returned from this function.
errHandlerFunctionThe first error callback to be registered with Deferred. It has the opportunity to do cleanup on an error. It will receive two arguments: error (the Error object) and dfd, the Deferred object returned from this function.
dojo._ioWatch
Defined by dojo
Watches the io request represented by dfd to see if it completes.
ParameterTypeDescription
dfdDeferredThe Deferred object to watch.
validCheckFunctionFunction used to check if the IO request is still valid. Gets the dfd object as its only argument.
ioCheckFunctionFunction used to check if basic IO call worked. Gets the dfd object as its only argument.
resHandleFunctionFunction used to process response. Gets the dfd object as its only argument.
dojo._isBodyLtr
Defined by dojo
dojo._isButtonTag
Defined by dojo
True if the node is BUTTON or INPUT.type="button".
ParameterTypeDescription
nodeDomNode
dojo._isDocumentOk
Defined by dojo
Returns Boolean
ParameterTypeDescription
http
dojo._isLocalUrl
Defined by dojo
determines if URI is local or not.
ParameterTypeDescription
uriString
dojo._loadInit
Defined by dojo
ParameterTypeDescription
e
dojo._loadModule
Defined by dojo
dojo._loadPath
Defined by dojo
Returns Boolean

Loads and interprets the script located at relpath, which is relative to the script root directory. If the script is found but its interpretation causes a runtime exception, that exception is not caught by us, so the caller will see it. We return a true value if and only if the script is found.

ParameterTypeDescription
relpathStringA relative path to a script (no leading '/', and typically ending in '.js').
moduleString
Optional.
A module whose existance to check for after loading a path. Can be used to determine success or failure of the load.
cbFunction
Optional.
a callback function to pass the result of evaluating the script
dojo._loadUri
Defined by dojo
Returns Boolean|Boolean: contents? true : false

Wanted to override getText(), but it is used by the widget code in too many, synchronous ways right now.

ParameterTypeDescription
uriStringa uri which points at the script to be loaded
cbFunctiona callback function to process the result of evaluating the script as an expression, typically used by the resource bundle loader to load JSON-style resources
currentIsXDomainboolean
moduleString
dojo._loadUriAndCheck
Defined by dojo
Returns Boolean
calls loadUri then findModule and returns true if both succeed
ParameterTypeDescription
uriString
moduleNameString
cbFunction
Optional.
dojo._mixin
Defined by dojo
Returns Object
Adds all properties and methods of source to target. This addition is "prototype extension safe", so that instances of objects will not pass along prototype defaults.
ParameterTypeDescription
targetObject
sourceObject
dojo._moduleHasPrefix
Defined by dojo
Returns Boolean
checks to see if module has been established
ParameterTypeDescription
moduleString
dojo._modulesLoaded
Defined by dojo
dojo._setBox
Defined by dojo
sets width/height/left/top in the current (native) box-model dimentions. Uses the unit passed in u.
ParameterTypeDescription
nodeDomNodeDOM Node reference. Id string not supported for performance reasons.
lNumber
Optional.
left offset from parent.
tNumber
Optional.
top offset from parent.
wNumber
Optional.
width in current box model.
hNumber
Optional.
width in current box model.
uString
Optional.
unit measure to use for other measures. Defaults to "px".
dojo._setContentSize
Defined by dojo
Sets the size of the node's contents, irrespective of margins, padding, or borders.
ParameterTypeDescription
nodeDomNode
widthPxNumber
heightPxNumber
computedStyleObject
dojo._setMarginBox
Defined by dojo
sets the size of the node's margin box and placement (left/top), irrespective of box model. Think of it as a passthrough to dojo._setBox that handles box-model vagaries for you.
ParameterTypeDescription
nodeDomNode
leftPxNumber
Optional.
topPxNumber
Optional.
widthPxNumber
Optional.
heightPxNumber
Optional.
computedStyleObject
dojo._setOpacity
Defined by dojo
Returns Number: Number between 0 and 1
set the opacity of the passed node portably. Returns the new opacity of the node.
ParameterTypeDescription
nodeDOMNodea reference to a DOM node. Does NOT support taking an ID string for performance reasons.
opacityNumberA Number between 0 and 1. 0 specifies transparent.
dojo._spidermonkeyCurrentFile
Defined by dojo
ParameterTypeDescription
depth
dojo._toArray
Defined by dojo
Converts an array-like object (i.e. arguments, DOMCollection) to an array. Returns a new Array with the elements of obj.
ParameterTypeDescription
objObjectthe object to "arrayify". We expect the object to have, at a minimum, a length property which corresponds to integer-indexed properties.
offsetNumber
Optional.
the location in obj to start iterating from. Defaults to 0. Optional.
startWithArray
Optional.
An array to pack with the properties of obj. If provided, properties in obj are appended at the end of startWith and startWith is the returned array.
dojo._toDom
Defined by dojo
Returns DOMNode: DocumentFragment
converts HTML string into DOM nodes.
ParameterTypeDescription
fragStringthe HTML fragment
docDocumentNode
Optional.
optional document to use when creating DOM nodes, defaults to dojo.doc if not specified.
Example 1
Create a table row:
	var tr = dojo._toDom("<tr><td>First!</td></tr>");
dojo._toPixelValue
Defined by dojo
ParameterTypeDescription
element
value
avalue
dojo._usesBorderBox
Defined by dojo
Returns boolean
True if the node uses border-box layout.
ParameterTypeDescription
nodeDomNode
dojo._xdClearInterval
Defined by dojo
Internal xd loader function. Clears the interval timer used to check on the status of in-flight xd module resource requests.
dojo._xdCreateResource
Defined by dojo
Returns String
Internal xd loader function. Creates an xd module source given an non-xd module contents.
ParameterTypeDescription
contentsString
resourceNameString
resourcePathString
dojo._xdDebugFileLoaded
Defined by dojo
ParameterTypeDescription
resourceName
dojo._xdEvalReqs
Defined by dojo
Internal xd loader function. Does a depth first, breadth second search and eval of required modules.
ParameterTypeDescription
reqChainArray
dojo._xdExtractLoadInits
Defined by dojo
ParameterTypeDescription
fileContentsString
dojo._xdInitExtraLocales
Defined by dojo
dojo._xdIsXDomainPath
Defined by dojo
Figure out whether the path is local or x-domain If there is a colon before the first / then, we have a URL with a protocol.
ParameterTypeDescription
relpathstring
dojo._xdLoadFlattenedBundle
Defined by dojo
Internal xd loader function. Used when loading a flattened localized bundle via a script tag.
ParameterTypeDescription
moduleNameString
bundleNameString
localeString
Optional.
bundleDataObject
dojo._xdNotifyLoaded
Defined by dojo
dojo._xdReset
Defined by dojo
Internal xd loader function. Resets the xd state.
dojo._xdResourceLoaded
Defined by dojo
Internal xd loader function. Called by an xd module resource when it has been loaded via a script tag.
ParameterTypeDescription
resObject
dojo._xdUnpackDependency
Defined by dojo
Returns Object
Internal xd loader function. Determines what to do with a dependency that was listed in an xd version of a module contents.
ParameterTypeDescription
depArray
dojo._xdWalkReqs
Defined by dojo
Internal xd loader function. Walks the requires and evaluates module resource contents in the right order.
dojo._xdWatchInFlight
Defined by dojo
Internal xd loader function. Monitors in-flight requests for xd module resources.
dojo._xhrObj
Defined by dojo
ParameterTypeDescription
args
dojo.addClass
Defined by dojo
Adds the specified classes to the end of the class list on the passed node. Will not re-apply duplicate classes.
ParameterTypeDescription
nodeDomNode|StringString ID or DomNode reference to add a class string too
classStrString|ArrayA String class name to add, or several space-separated class names, or an array of class names.
Example 1
Add a class to some node:
	dojo.addClass("someNode", "anewClass");
Example 2
Add two classes at once:
	dojo.addClass("someNode", "firstClass secondClass");
Example 3
Add two classes at once (using array):
	dojo.addClass("someNode", ["firstClass", "secondClass"]);
Example 4
Available in `dojo.NodeList` for multiple additions
	dojo.query("ul > li").addClass("firstLevel");
dojo.addOnLoad
Defined by dojo

Registers a function to be triggered after the DOM has finished loading and dojo.require modules have loaded. Widgets declared in markup have been instantiated if djConfig.parseOnLoad is true when this fires. Images and CSS files may or may not have finished downloading when the specified function is called. (Note that widgets' CSS and HTML code is guaranteed to be downloaded before said widgets are instantiated, though including css resouces BEFORE any script elements is highly recommended).

ParameterTypeDescription
objObject
functionNameString|Function
Optional.
Example 1
Register an anonymous function to run when everything is ready
	dojo.addOnLoad(function(){ doStuff(); });
Example 2
Register a function to run when everything is ready by pointer:
	var init = function(){ doStuff(); }
	dojo.addOnLoad(init);
Example 3
Register a function to run scoped to `object`, either by name or anonymously:
	dojo.addOnLoad(object, "functionName");
	dojo.addOnLoad(object, function(){ doStuff(); });
dojo.addOnWindowUnload
Defined by dojo
registers a function to be triggered when window.onunload fires. Be careful trying to modify the DOM or access JavaScript properties during this phase of page unloading: they may not always be available. Consider dojo.addOnUnload() if you need to modify the DOM or do heavy JavaScript work.
ParameterTypeDescription
objObject
Optional.
functionNameString|Function
Optional.
Example 1
	dojo.addOnWindowUnload(functionPointer)
	dojo.addOnWindowUnload(object, "functionName")
	dojo.addOnWindowUnload(object, function(){ /* ... */});
dojo.anim
Defined by dojo
Returns dojo.Animation

dojo.anim is a simpler (but somewhat less powerful) version of dojo.animateProperty. It uses defaults for many basic properties and allows for positional parameters to be used in place of the packed "property bag" which is used for other Dojo animation methods. The dojo.Animation object returned from dojo.anim will be already playing when it is returned from this function, so calling play() on it again is (usually) a no-op.

ParameterTypeDescription
nodeDOMNode|Stringa DOM node or the id of a node to animate CSS properties on
propertiesObject
durationInteger
Optional.
The number of milliseconds over which the animation should run. Defaults to the global animation default duration (350ms).
easingFunction
Optional.
An easing function over which to calculate acceleration and deceleration of the animation through its duration. A default easing algorithm is provided, but you may plug in any you wish. A large selection of easing algorithms are available in dojo.fx.easing.
onEndFunction
Optional.
A function to be called when the animation finishes running.
delayInteger
Optional.
The number of milliseconds to delay beginning the animation by. The default is 0.
Example 1
Fade out a node
	dojo.anim("id", { opacity: 0 });
Example 2
Fade out a node over a full second
	dojo.anim("id", { opacity: 0 }, 1000);
dojo.animateProperty
Defined by dojo
Returns dojo.Animation

The standard animation doesn't know what to do with something like rect(...). This class identifies complex properties by they being a string and having parenthesis. If so, that property is made into a dojox.fx._Complex object and the getValue() is obtained from there.

ParameterTypeDescription
argsdojo.__AnimArgs
ParameterTypeDescription
propertiesObject 
Example 1
A simple animation that changes the width of the specified node.
	dojo.animateProperty({
		node: "nodeId",
		properties: { width: 400 },
	}).play();
Dojo figures out the start value for the width and converts the
integer specified for the width to the more expressive but verbose form `{ width: { end: '400', units: 'px' } }` which you can also specify directly. Defaults to 'px' if ommitted.
Example 2
Animate width, height, and padding over 2 seconds... the pedantic way:
	dojo.animateProperty({ node: node, duration:2000,
		properties: {
			width: { start: '200', end: '400', units:"px" },
			height: { start:'200', end: '400', units:"px" },
			paddingTop: { start:'5', end:'50', units:"px" }
		}
	}).play();
Note 'paddingTop' is used over 'padding-top'. Multi-name CSS properties
are written using "mixed case", as the hyphen is illegal as an object key.
Example 3
Plug in a different easing function and register a callback for when the animation ends. Easing functions accept values between zero and one and return a value on that basis. In this case, an exponential-in curve.
	dojo.animateProperty({
		node: "nodeId",
		// dojo figures out the start value
		properties: { width: { end: 400 } },
		easing: function(n){
			return (n==0) ? 0 : Math.pow(2, 10 * (n - 1));
		},
		onEnd: function(node){
			// called when the animation finishes. The animation
			// target is passed to this function
		}
	}).play(500); // delay playing half a second
Example 4
Like all `dojo.Animation`s, animateProperty returns a handle to the Animation instance, which fires the events common to Dojo FX. Use `dojo.connect` to access these events outside of the Animation definiton:
	var anim = dojo.animateProperty({
		node:"someId",
		properties:{
			width:400, height:500
		}
	});
	dojo.connect(anim,"onEnd", function(){
		console.log("animation ended");
	});
	// play the animation now:
	anim.play();
Example 5
Each property can be a function whose return value is substituted along. Additionally, each measurement (eg: start, end) can be a function. The node reference is passed direcly to callbacks.
	dojo.animateProperty({
		node:"mine",
		properties:{
			height:function(node){
				// shrink this node by 50%
				return dojo.position(node).h / 2
			},
			width:{
				start:function(node){ return 100; },
				end:function(node){ return 200; }
			}
		}
	}).play();
Example 6
	var ani = dojo.animateProperty({
		node:dojo.byId("myDiv"),
		duration:600,
		properties:{
			clip:{start:'rect(0px 50px 50px 0px)', end:'rect(10px 30px 30px 10px)'}
		}
	}).play();
dojo.attr
Defined by dojo
Returns DomNode|Anything: when used as a getter, the value of the requested attribute or null if that attribute does not have a specified or default value; when used as a setter, the DOM node

Handles normalized getting and setting of attributes on DOM Nodes. If 2 arguments are passed, and a the second argumnt is a string, acts as a getter. If a third argument is passed, or if the second argument is a map of attributes, acts as a setter. When passing functions as values, note that they will not be directly assigned to slots on the node, but rather the default behavior will be removed and the new behavior will be added using dojo.connect(), meaning that event handler properties will be normalized and that some caveats with regards to non-standard behaviors for onsubmit apply. Namely that you should cancel form submission using dojo.stopEvent() on the passed event object instead of returning a boolean value from the handler itself.

ParameterTypeDescription
nodeDomNode|Stringid or reference to the element to get or set the attribute on
nameString|Objectthe name of the attribute to get or set.
valueString
Optional.
The value to set for the attribute
Example 1
	// get the current value of the "foo" attribute on a node
	dojo.attr(dojo.byId("nodeId"), "foo");
	// or we can just pass the id:
	dojo.attr("nodeId", "foo");
Example 2
	// use attr() to set the tab index
	dojo.attr("nodeId", "tabIndex", 3);
Example 3
Set multiple values at once, including event handlers:
	dojo.attr("formId", {
		"foo": "bar",
		"tabIndex": -1,
		"method": "POST",
		"onsubmit": function(e){
			// stop submitting the form. Note that the IE behavior
			// of returning true or false will have no effect here
			// since our handler is connect()ed to the built-in
			// onsubmit behavior and so we need to use
			// dojo.stopEvent() to ensure that the submission
			// doesn't proceed.
			dojo.stopEvent(e);
			// submit the form with Ajax
			dojo.xhrPost({ form: "formId" });
		}
	});
Example 4
Style is s special case: Only set with an object hash of styles
	dojo.attr("someNode",{
		id:"bar",
		style:{
			width:"200px", height:"100px", color:"#000"
		}
	});
Example 5
Again, only set style as an object hash of styles:
	var obj = { color:"#fff", backgroundColor:"#000" };
	dojo.attr("someNode", "style", obj);
	// though shorter to use `dojo.style()` in this case:
	dojo.style("someNode", obj);
dojo.blendColors
Defined by dojo
Returns dojo.Color
Blend colors end and start with weight from 0 to 1, 0.5 being a 50/50 blend, can reuse a previously allocated dojo.Color object for the result
ParameterTypeDescription
startdojo.Color
enddojo.Color
weightNumber
objdojo.Color
Optional.
dojo.body
Defined by dojo
Returns Node
Return the body element of the document return the body object associated with dojo.doc
Example 1
	dojo.body().appendChild(dojo.doc.createElement('div'));
dojo.byId
Defined by dojo
Returns assume it's a node|DomNode
Returns DOM node with matching id attribute or null if not found. If id is a DomNode, this function is a no-op.
ParameterTypeDescription
idString|DOMNodeA string to match an HTML id attribute or a reference to a DOM Node
docDocumentDocument to work in. Defaults to the current value of dojo.doc. Can be used to retrieve node references from other documents.
Example 1
Look up a node by ID:
	var n = dojo.byId("foo");
Example 2
Check if a node exists, and use it.
	var n = dojo.byId("bar");
	if(n){ doStuff() ... }
Example 3
Allow string or DomNode references to be passed to a custom function:
	var foo = function(nodeOrId){
		nodeOrId = dojo.byId(nodeOrId);
		// ... more stuff
	}
dojo.clone
Defined by dojo
Returns anything|Node|Date|Object
Clones objects (including DOM nodes) and all children. Warning: do not clone cyclic structures.
ParameterTypeDescription
oanything
dojo.colorFromArray
Defined by dojo
Returns dojo.Color: A dojo.Color object. If obj is passed, it will be the return value.
Builds a dojo.Color from a 3 or 4 element array, mapping each element in sequence to the rgb(a) values of the color.
ParameterTypeDescription
aArray
objdojo.Color
Optional.
Example 1
var myColor = dojo.colorFromArray([237,237,237,0.5]); // grey, 50% alpha
dojo.colorFromHex
Defined by dojo
Returns dojo.Color: A dojo.Color object. If obj is passed, it will be the return value.
Converts a hex string with a '#' prefix to a color object. Supports 12-bit #rgb shorthand. Optionally accepts a dojo.Color object to update with the parsed value.
ParameterTypeDescription
colorString
objdojo.Color
Optional.
Example 1
var thing = dojo.colorFromHex("#ededed"); // grey, longhand
Example 2
var thing = dojo.colorFromHex("#000"); // black, shorthand
dojo.colorFromRgb
Defined by dojo
Returns dojo.Color: A dojo.Color object. If obj is passed, it will be the return value.

this function can handle all 4 CSS3 Color Module formats: rgb, rgba, hsl, hsla, including rgb(a) with percentage values.

ParameterTypeDescription
colorString
objdojo.Color
Optional.
dojo.colorFromString
Defined by dojo
A dojo.Color object. If obj is passed, it will be the return value.

Acceptable input values for str may include arrays of any form accepted by dojo.colorFromArray, hex strings such as "#aaaaaa", or rgb or rgba strings such as "rgb(133, 200, 16)" or "rgba(10, 10, 10, 50)"

ParameterTypeDescription
strString
objdojo.Color
Optional.
dojo.connect
Defined by dojo

Connects listeners to actions, so that after event fires, a listener is called with the same arguments passed to the original function. Since dojo.connect allows the source of events to be either a "regular" JavaScript function or a DOM event, it provides a uniform interface for listening to all the types of events that an application is likely to deal with though a single, unified interface. DOM programmers may want to think of it as "addEventListener for everything and anything". When setting up a connection, the event parameter must be a string that is the name of the method/event to be listened for. If obj is null, dojo.global is assumed, meaning that connections to global methods are supported but also that you may inadvertently connect to a global by passing an incorrect object name or invalid reference. dojo.connect generally is forgiving. If you pass the name of a function or method that does not yet exist on obj, connect will not fail, but will instead set up a stub method. Similarly, null arguments may simply be omitted such that fewer than 4 arguments may be required to set up a connection See the examples for details. The return value is a handle that is needed to remove this connection with dojo.disconnect.

ParameterTypeDescription
objObject|nullThe source object for the event function. Defaults to dojo.global if null. If obj is a DOM node, the connection is delegated to the DOM event manager (unless dontFix is true).
eventStringname of the event function in obj. I.e. identifies a property obj[event].
contextObject|nullThe object that method will receive as "this". If context is null and method is a function, then method inherits the context of event. If method is a string then context must be the source object object for method (context[method]). If context is null, dojo.global is used.
methodString|FunctionA function reference, or name of a function in context. The function identified by method fires after event does. method receives the same arguments as the event. See context argument comments for information on method's scope.
dontFixBoolean
Optional.
If obj is a DOM node, set dontFix to true to prevent delegation of this connection to the DOM event manager.
Example 1
When obj.onchange(), do ui.update():
	dojo.connect(obj, "onchange", ui, "update");
	dojo.connect(obj, "onchange", ui, ui.update); // same
Example 2
Using return value for disconnect:
	var link = dojo.connect(obj, "onchange", ui, "update");
	...
	dojo.disconnect(link);
Example 3
When onglobalevent executes, watcher.handler is invoked:
	dojo.connect(null, "onglobalevent", watcher, "handler");
Example 4
When ob.onCustomEvent executes, customEventHandler is invoked:
	dojo.connect(ob, "onCustomEvent", null, "customEventHandler");
	dojo.connect(ob, "onCustomEvent", "customEventHandler"); // same
Example 5
When ob.onCustomEvent executes, customEventHandler is invoked with the same scope (this):
	dojo.connect(ob, "onCustomEvent", null, customEventHandler);
	dojo.connect(ob, "onCustomEvent", customEventHandler); // same
Example 6
When globalEvent executes, globalHandler is invoked with the same scope (this):
	dojo.connect(null, "globalEvent", null, globalHandler);
	dojo.connect("globalEvent", globalHandler); // same
dojo.connectPublisher
Defined by dojo
Returns Handle
Ensure that every time obj.event() is called, a message is published on the topic. Returns a handle which can be passed to dojo.disconnect() to disable subsequent automatic publication on the topic.
ParameterTypeDescription
topicStringThe name of the topic to publish.
objObject|nullThe source object for the event function. Defaults to dojo.global if null.
eventStringThe name of the event function in obj. I.e. identifies a property obj[event].
Example 1
	dojo.connectPublisher("/ajax/start", dojo, "xhrGet");
dojo.contentBox
Defined by dojo
Returns Object

Returns an object in the expected format of box (regardless if box is passed). The object might look like: { l: 50, t: 200, w: 300: h: 150 } for a node offset from its parent 50px to the left, 200px from the top with a content width of 300px and a content-height of 150px. Note that the content box may have a much larger border or margin box, depending on the box model currently in use and CSS values set/inherited for node. While the getter will return top and left values, the setter only accepts setting the width and height.

ParameterTypeDescription
nodeDomNode|Stringid or reference to DOM Node to get/set box for
boxObject
Optional.
If passed, denotes that dojo.contentBox() should update/set the content box for node. Box is an object in the above format, but only w (width) and h (height) are supported. All properties are optional if passed.
dojo.coords
Defined by dojo

Returns an object that measures margin-box (w)idth/(h)eight and absolute position x/y of the border-box. Also returned is computed (l)eft and (t)op values in pixels from the node's offsetParent as returned from marginBox(). Return value will be in the form: { l: 50, t: 200, w: 300: h: 150, x: 100, y: 300 } Does not act as a setter. If includeScroll is passed, the x and y params are affected as one would expect in dojo.position().

ParameterTypeDescription
nodeDomNode|String
includeScrollBoolean
Optional.
dojo.create
Defined by dojo
Returns DomNode: DomNode

A DOM Element creation function. A shorthand method for creating a node or a fragment, and allowing for a convenient optional attribute setting step, as well as an optional DOM placement reference. Attributes are set by passing the optional object through dojo.attr. See dojo.attr for noted caveats and nuances, and API if applicable. Placement is done via dojo.place, assuming the new node to be the action node, passing along the optional reference node and position.

ParameterTypeDescription
tagString|DomNodeA string of the element to create (eg: "div", "a", "p", "li", "script", "br"), or an existing DOM node to process.
attrsObjectAn object-hash of attributes to set on the newly created node. Can be null, if you don't want to set any attributes/styles. See: dojo.attr for a description of available attributes.
refNodeString|DomNode
Optional.
Optional reference node. Used by dojo.place to place the newly created node somewhere in the dom relative to refNode. Can be a DomNode reference or String ID of a node.
posString
Optional.
Optional positional reference. Defaults to "last" by way of dojo.place, though can be set to "first","after","before","last", "replace" or "only" to further control the placement of the new node relative to the refNode. 'refNode' is required if a 'pos' is specified.
Example 1
Create a DIV:
	var n = dojo.create("div");
Example 2
Create a DIV with content:
	var n = dojo.create("div", { innerHTML:"<p>hi</p>" });
Example 3
Place a new DIV in the BODY, with no attributes set
	var n = dojo.create("div", null, dojo.body());
Example 4
Create an UL, and populate it with LI's. Place the list as the first-child of a node with id="someId":
	var ul = dojo.create("ul", null, "someId", "first");
	var items = ["one", "two", "three", "four"];
	dojo.forEach(items, function(data){
		dojo.create("li", { innerHTML: data }, ul);
	});
Example 5
Create an anchor, with an href. Place in BODY:
	dojo.create("a", { href:"foo.html", title:"Goto FOO!" }, dojo.body());
Example 6
Create a `dojo.NodeList()` from a new element (for syntatic sugar):
	dojo.query(dojo.create('div'))
		.addClass("newDiv")
		.onclick(function(e){ console.log('clicked', e.target) })
		.place("#someNode"); // redundant, but cleaner.
dojo.declare
Defined by dojo
Returns Function: New constructor function.

Create a constructor using a compact notation for inheritance and prototype extension. Mixin ancestors provide a type of multiple inheritance. Prototypes of mixin ancestors are copied to the new class: changes to mixin prototypes will not affect classes to which they have been mixed in. Ancestors can be compound classes created by this version of dojo.declare. In complex cases all base classes are going to be linearized according to C3 MRO algorithm (see http://www.python.org/download/releases/2.3/mro/ for more details). "className" is cached in "declaredClass" property of the new class, if it was supplied. The immediate super class will be cached in "superclass" property of the new class. Methods in "props" will be copied and modified: "nom" property (the declared name of the method) will be added to all copied functions to help identify them for the internal machinery. Be very careful, while reusing methods: if you use the same function under different names, it can produce errors in some cases. It is possible to use constructors created "manually" (without dojo.declare) as bases. They will be called as usual during the creation of an instance, their methods will be chained, and even called by "this.inherited()". Special property "-chains-" governs how to chain methods. It is a dictionary, which uses method names as keys, and hint strings as values. If a hint string is "after", this method will be called after methods of its base classes. If a hint string is "before", this method will be called before methods of its base classes. If "constructor" is not mentioned in "-chains-" property, it will be chained using the legacy mode: using "after" chaining, calling preamble() method before each constructor, if available, and calling postscript() after all constructors were executed. If the hint is "after", it is chained as a regular method, but postscript() will be called after the chain of constructors. "constructor" cannot be chained "before", but it allows a special hint string: "manual", which means that constructors are not going to be chained in any way, and programmer will call them manually using this.inherited(). In the latter case postscript() will be called after the construction. All chaining hints are "inherited" from base classes and potentially can be overridden. Be very careful when overriding hints! Make sure that all chained methods can work in a proposed manner of chaining. Once a method was chained, it is impossible to unchain it. The only exception is "constructor". You don't need to define a method in order to supply a chaining hint. If a method is chained, it cannot use this.inherited() because all other methods in the hierarchy will be called automatically. Usually constructors and initializers of any kind are chained using "after" and destructors of any kind are chained as "before". Note that chaining assumes that chained methods do not return any value: any returned value will be discarded.

ParameterTypeDescription
classNameString:
Optional.
The optional name of the constructor (loosely, a "class") stored in the "declaredClass" property in the created prototype. It will be used as a global name for a created constructor.
superclassFunction|Function[]:May be null, a Function, or an Array of Functions. This argument specifies a list of bases (the left-most one is the most deepest base).
propsObject:An object whose properties are copied to the created prototype. Add an instance-initialization function by making it a property named "constructor".
Example 1
	dojo.declare("my.classes.bar", my.classes.foo, {
		// properties to be added to the class prototype
		someValue: 2,
		// initialization function
		constructor: function(){
			this.myComplicatedObject = new ReallyComplicatedObject();
		},
		// other functions
		someMethod: function(){
			doStuff();
		}
	});
Example 2
	var MyBase = dojo.declare(null, {
		// constructor, properties, and methods go here
		// ...
	});
	var MyClass1 = dojo.declare(MyBase, {
		// constructor, properties, and methods go here
		// ...
	});
	var MyClass2 = dojo.declare(MyBase, {
		// constructor, properties, and methods go here
		// ...
	});
	var MyDiamond = dojo.declare([MyClass1, MyClass2], {
		// constructor, properties, and methods go here
		// ...
	});
Example 3
	var F = function(){ console.log("raw constructor"); };
	F.prototype.method = function(){
		console.log("raw method");
	};
	var A = dojo.declare(F, {
		constructor: function(){
			console.log("A.constructor");
		},
		method: function(){
			console.log("before calling F.method...");
			this.inherited(arguments);
			console.log("...back in A");
		}
	});
	new A().method();
	// will print:
	// raw constructor
	// A.constructor
	// before calling F.method...
	// raw method
	// ...back in A
Example 4
	var A = dojo.declare(null, {
		"-chains-": {
			destroy: "before"
		}
	});
	var B = dojo.declare(A, {
		constructor: function(){
			console.log("B.constructor");
		},
		destroy: function(){
			console.log("B.destroy");
		}
	});
	var C = dojo.declare(B, {
		constructor: function(){
			console.log("C.constructor");
		},
		destroy: function(){
			console.log("C.destroy");
		}
	});
	new C().destroy();
	// prints:
	// B.constructor
	// C.constructor
	// C.destroy
	// B.destroy
Example 5
	var A = dojo.declare(null, {
		"-chains-": {
			constructor: "manual"
		}
	});
	var B = dojo.declare(A, {
		constructor: function(){
			// ...
			// call the base constructor with new parameters
			this.inherited(arguments, [1, 2, 3]);
			// ...
		}
	});
Example 6
	var A = dojo.declare(null, {
		"-chains-": {
			m1: "before"
		},
		m1: function(){
			console.log("A.m1");
		},
		m2: function(){
			console.log("A.m2");
		}
	});
	var B = dojo.declare(A, {
		"-chains-": {
			m2: "after"
		},
		m1: function(){
			console.log("B.m1");
		},
		m2: function(){
			console.log("B.m2");
		}
	});
	var x = new B();
	x.m1();
	// prints:
	// B.m1
	// A.m1
	x.m2();
	// prints:
	// A.m2
	// B.m2
dojo.delegate
Defined by dojo
an Object of anonymous type

This is a small implementaton of the Boodman/Crockford delegation pattern in JavaScript. An intermediate object constructor mediates the prototype chain for the returned object, using it to delegate down to obj for property lookup when object-local lookup fails. This can be thought of similarly to ES4's "wrap", save that it does not act on types but rather on pure objects.

ParameterTypeDescription
objTheobject to delegate to for properties not found directly on the return object or in props.
propsanobject containing properties to assign to the returned object
Example 1
	var foo = { bar: "baz" };
	var thinger = dojo.delegate(foo, { thud: "xyzzy"});
	thinger.bar == "baz"; // delegated to foo
	foo.thud == undefined; // by definition
	thinger.thud == "xyzzy"; // mixed in from props
	foo.bar = "thonk";
	thinger.bar == "thonk"; // still delegated to foo's bar
dojo.deprecated
Defined by dojo
Log a debug message to indicate that a behavior has been deprecated.
ParameterTypeDescription
behaviourStringThe API or behavior being deprecated. Usually in the form of "myApp.someFunction()".
extraString
Optional.
Text to append to the message.
removalString
Optional.
Text to indicate when in the future the behavior will be removed.
Example 1
	dojo.deprecated("myApp.getTemp()", "use myApp.getLocaleTemp() instead", "1.0");
dojo.destroy
Defined by dojo

Removes a node from its parent, clobbering it and all of its children. Function only works with DomNodes, and returns nothing.

ParameterTypeDescription
nodeString|DomNodeA String ID or DomNode reference of the element to be destroyed
Example 1
Destroy a node byId:
	dojo.destroy("someId");
Example 2
Destroy all nodes in a list by reference:
	dojo.query(".someNode").forEach(dojo.destroy);
dojo.disconnect
Defined by dojo

Removes the connection between event and the method referenced by handle.

ParameterTypeDescription
handleHandlethe return value of the dojo.connect call that created the connection.
dojo.empty
Defined by dojo
safely removes all children of the node.
ParameterTypeDescription
nodeDOMNode|Stringa reference to a DOM node or an id.
Example 1
Destroy node's children byId:
	dojo.empty("someId");
Example 2
Destroy all nodes' children in a list by reference:
	dojo.query(".someNode").forEach(dojo.empty);
dojo.eval
Defined by dojo
Returns Object: The result of the evaluation. Often `undefined`

Placed in a separate function to minimize size of trapped exceptions. Calling eval() directly from some other scope may complicate tracebacks on some platforms.

ParameterTypeDescription
scriptFragmentString
dojo.every
Defined by dojo
Returns Boolean

This function corresponds to the JavaScript 1.6 Array.every() method, with one difference: when run over sparse arrays, this implemenation passes the "holes" in the sparse array to the callback function with a value of undefined. JavaScript 1.6's every skips the holes in the sparse array. For more details, see: https://developer.mozilla.org/en/CoreJavaScript1.5_Reference/Objects/Array/every

ParameterTypeDescription
arrArray|Stringthe array to iterate on. If a string, operates on individual characters.
callbackFunction|Stringa function is invoked with three arguments: item, index, and array and returns true if the condition is met.
thisObjectObject
Optional.
may be used to scope the call to callback
Example 1
	// returns false
	dojo.every([1, 2, 3, 4], function(item){ return item>1; });
Example 2
	// returns true
	dojo.every([1, 2, 3, 4], function(item){ return item>0; });
dojo.exists
Defined by dojo
Returns Boolean

useful for longer api chains where you have to test each object in the chain. Useful only for object and method detection. Not useful for testing generic properties on an object. In particular, dojo.exists("foo.bar") when foo.bar = "" will return false. Use ("bar" in foo) to test for those cases.

ParameterTypeDescription
nameStringPath to an object, in the form "A.B.C".
objObject
Optional.
to use as root of path. Defaults to 'dojo.global'. Null may be passed.
Example 1
	// define an object
	var foo = {
		bar: { }
	};
	// search the global scope
	dojo.exists("foo.bar"); // true
	dojo.exists("foo.bar.baz"); // false
	// search from a particular scope
	dojo.exists("bar", foo); // true
	dojo.exists("bar.baz", foo); // false
dojo.exit
Defined by dojo
ParameterTypeDescription
exitcode
dojo.experimental
Defined by dojo

This can be used to mark a function, file, or module as experimental. Experimental code is not ready to be used, and the APIs are subject to change without notice. Experimental code may be completed deleted without going through the normal deprecation process.

ParameterTypeDescription
moduleNameStringThe name of a module, or the name of a module file or a specific function
extraString
Optional.
some additional message for the user
Example 1
	dojo.experimental("dojo.data.Result");
Example 2
	dojo.experimental("dojo.weather.toKelvin()", "PENDING approval from NOAA");
dojo.extend
Defined by dojo
Returns Object
Adds all properties and methods of props to constructor's prototype, making them available to all instances created with constructor.
ParameterTypeDescription
constructorObject
propsObject
One or more can be passed.
dojo.fadeIn
Defined by dojo
Returns dojo.Animation
Returns an animation that will fade node defined in 'args' from its current opacity to fully opaque.
ParameterTypeDescription
argsdojo.__FadeArgs
ParameterTypeDescription
nodeDOMNode|String

The node referenced in the animation

durationInteger

Duration of the animation in milliseconds.

dojo.fadeOut
Defined by dojo
Returns dojo.Animation
Returns an animation that will fade node defined in 'args' from its current opacity to fully transparent.
ParameterTypeDescription
argsdojo.__FadeArgs
ParameterTypeDescription
nodeDOMNode|String

The node referenced in the animation

durationInteger

Duration of the animation in milliseconds.

dojo.fieldToObject
Defined by dojo
Returns Object

Returns the value encoded in a form field as as a string or an array of strings. Disabled form elements and unchecked radio and checkboxes are skipped. Multi-select elements are returned as an array of string values.

ParameterTypeDescription
inputNodeDOMNode||String
dojo.filter
Defined by dojo
Returns Array

This function corresponds to the JavaScript 1.6 Array.filter() method, with one difference: when run over sparse arrays, this implemenation passes the "holes" in the sparse array to the callback function with a value of undefined. JavaScript 1.6's filter skips the holes in the sparse array. For more details, see: https://developer.mozilla.org/en/CoreJavaScript1.5_Reference/Objects/Array/filter

ParameterTypeDescription
arrArraythe array to iterate over.
callbackFunction|Stringa function that is invoked with three arguments (item, index, array). The return of this function is expected to be a boolean which determines whether the passed-in item will be included in the returned array.
thisObjectObject
Optional.
may be used to scope the call to callback
Example 1
	// returns [2, 3, 4]
	dojo.filter([1, 2, 3, 4], function(item){ return item>1; });
dojo.fixEvent
Defined by dojo
normalizes properties on the event object including event bubbling methods, keystroke normalization, and x/y positions
ParameterTypeDescription
evtEventnative event object
senderDOMNodenode to treat as "currentTarget"
dojo.forEach
Defined by dojo

This function corresponds to the JavaScript 1.6 Array.forEach() method, with one difference: when run over sparse arrays, this implemenation passes the "holes" in the sparse array to the callback function with a value of undefined. JavaScript 1.6's forEach skips the holes in the sparse array. For more details, see: https://developer.mozilla.org/en/CoreJavaScript1.5_Reference/Objects/Array/forEach

ParameterTypeDescription
arrArray|Stringthe array to iterate over. If a string, operates on individual characters.
callbackFunction|Stringa function is invoked with three arguments: item, index, and array
thisObjectObject
Optional.
may be used to scope the call to callback
Example 1
	// log out all members of the array:
	dojo.forEach(
		[ "thinger", "blah", "howdy", 10 ],
		function(item){
			console.log(item);
		}
	);
Example 2
	// log out the members and their indexes
	dojo.forEach(
		[ "thinger", "blah", "howdy", 10 ],
		function(item, idx, arr){
			console.log(item, "at index:", idx);
		}
	);
Example 3
	// use a scoped object member as the callback
	var obj = {
		prefix: "logged via obj.callback:",
		callback: function(item){
			console.log(this.prefix, item);
		}
	};
	// specifying the scope function executes the callback in that scope
	dojo.forEach(
		[ "thinger", "blah", "howdy", 10 ],
		obj.callback,
		obj
	);
	// alternately, we can accomplish the same thing with dojo.hitch()
	dojo.forEach(
		[ "thinger", "blah", "howdy", 10 ],
		dojo.hitch(obj, "callback")
	);
dojo.formToJson
Defined by dojo
Returns String
Create a serialized JSON string from a form node or string ID identifying the form to serialize
ParameterTypeDescription
formNodeDOMNode||String
prettyPrintBoolean
Optional.
dojo.formToObject
Defined by dojo
Returns Object

Returns the values encoded in an HTML form as string properties in an object which it then returns. Disabled form elements, buttons, and other non-value form elements are skipped. Multi-select elements are returned as an array of string values.

ParameterTypeDescription
formNodeDOMNode||String
Example 1
This form:
	<form id="test_form">
		<input type="text" name="blah" value="blah">
		<input type="text" name="no_value" value="blah" disabled>
		<input type="button" name="no_value2" value="blah">
		<select type="select" multiple name="multi" size="5">
			<option value="blah">blah</option>
			<option value="thud" selected>thud</option>
			<option value="thonk" selected>thonk</option>
		</select>
	</form>
yields this object structure as the result of a call to
formToObject():
	{
		blah: "blah",
		multi: [
			"thud",
			"thonk"
		]
	};
dojo.formToQuery
Defined by dojo
Returns String
Returns a URL-encoded string representing the form passed as either a node or string ID identifying the form to serialize
ParameterTypeDescription
formNodeDOMNode||String
dojo.fromJson
Defined by dojo
Returns Object

Throws for invalid JSON strings, but it does not use a strict JSON parser. It delegates to eval(). The content passed to this method must therefore come from a trusted source.

ParameterTypeDescription
jsonStringa string literal of a JSON item, for instance: '{ "foo": [ "bar", 1, { "baz": "thud" } ] }'
dojo.getComputedStyle
Defined by dojo
Returns CSS2Properties

Gets a "computed style" object which can be used to gather information about the current state of the rendered node. Note that this may behave differently on different browsers. Values may have different formats and value encodings across browsers. Note also that this method is expensive. Wherever possible, reuse the returned object. Use the dojo.style() method for more consistent (pixelized) return values.

ParameterTypeDescription
nodeDOMNodeA reference to a DOM node. Does NOT support taking an ID string for speed reasons.
Example 1
	dojo.getComputedStyle(dojo.byId('foo')).borderWidth;
Example 2
Reusing the returned object, avoiding multiple lookups:
	var cs = dojo.getComputedStyle(dojo.byId("someNode"));
	var w = cs.width, h = cs.height;
dojo.getNodeProp
Defined by dojo
Returns Anything
Returns an effective value of a property or an attribute.
ParameterTypeDescription
nodeDomNode|Stringid or reference to the element to remove the attribute from
nameStringthe name of the attribute
dojo.getObject
Defined by dojo
Returns Object

Useful for longer api chains where you have to test each object in the chain, or when you have an object reference in string format.

ParameterTypeDescription
nameStringPath to an property, in the form "A.B.C".
createBoolean
Optional.
Optional. Defaults to false. If true, Objects will be created at any point along the 'path' that is undefined.
contextObject
Optional.
Optional. Object to use as root of path. Defaults to 'dojo.global'. Null may be passed.
dojo.hasAttr
Defined by dojo
Returns Boolean: true if the requested attribute is specified on the given element, and false otherwise
Returns true if the requested attribute is specified on the given element, and false otherwise.
ParameterTypeDescription
nodeDomNode|Stringid or reference to the element to check
nameStringthe name of the attribute
dojo.hasClass
Defined by dojo
Returns Boolean
Returns whether or not the specified classes are a portion of the class list currently applied to the node.
ParameterTypeDescription
nodeDomNode|StringString ID or DomNode reference to check the class for.
classStrStringA string class name to look for.
Example 1
Do something if a node with id="someNode" has class="aSillyClassName" present
	if(dojo.hasClass("someNode","aSillyClassName")){ ... }
dojo.hash
Defined by dojo
Returns String: when used as a getter, returns the current hash string. when used as a setter, returns the new hash string.

Handles getting and setting of location.hash. - If no arguments are passed, acts as a getter. - If a string is passed, acts as a setter.

ParameterTypeDescription
hashString
Optional.
String: the hash is set - #string.
replaceBoolean
Optional.
Boolean: If true, updates the hash value in the current history state instead of creating a new history state.
dojo.hitch
Defined by dojo
Returns Function
Returns a function that will only ever execute in the a given scope. This allows for easy use of object member functions in callbacks and other places in which the "this" keyword may otherwise not reference the expected scope. Any number of default positional arguments may be passed as parameters beyond "method". Each of these values will be used to "placehold" (similar to curry) for the hitched function.
ParameterTypeDescription
scopeObjectThe scope to use when method executes. If method is a string, scope is also the object containing method.
methodFunction|StringA function to be hitched to scope, or the name of the method in scope to be hitched.
Example 1
	dojo.hitch(foo, "bar")();
runs foo.bar() in the scope of foo
Example 2
	dojo.hitch(foo, myFunction);
returns a function that runs myFunction in the scope of foo
Example 3
Expansion on the default positional arguments passed along from hitch. Passed args are mixed first, additional args after.
	var foo = { bar: function(a, b, c){ console.log(a, b, c); } };
	var fn = dojo.hitch(foo, "bar", 1, 2);
	fn(3); // logs "1, 2, 3"
Example 4
	var foo = { bar: 2 };
	dojo.hitch(foo, function(){ this.bar = 10; })();
execute an anonymous function in scope of foo
dojo.indexOf
Defined by dojo
Returns Number

This method corresponds to the JavaScript 1.6 Array.indexOf method, with one difference: when run over sparse arrays, the Dojo function invokes the callback for every index whereas JavaScript 1.6's indexOf skips the holes in the sparse array. For details on this method, see: https://developer.mozilla.org/en/CoreJavaScript1.5_Reference/Objects/Array/indexOf

ParameterTypeDescription
arrayArray
valueObject
fromIndexInteger
Optional.
findLastBoolean
Optional.
dojo.isAlien
Defined by dojo
Returns Boolean
Returns true if it is a built-in function or some other kind of oddball that *should* report as a function but doesn't
ParameterTypeDescription
itanything
dojo.isArray
Defined by dojo
Returns Boolean
Return true if it is an Array. Does not work on Arrays created in other windows.
ParameterTypeDescription
itanything
dojo.isArrayLike
Defined by dojo
Returns Boolean: If it walks like a duck and quacks like a duck, return `true`

Doesn't strongly test for "arrayness". Instead, settles for "isn't a string or number and has a length property". Arguments objects and DOM collections will return true when passed to dojo.isArrayLike(), but will return false when passed to dojo.isArray().

ParameterTypeDescription
itanything
dojo.isCopyKey
Defined by dojo
Returns Boolean
Checks an event for the copy key (meta on Mac, and ctrl anywhere else)
ParameterTypeDescription
eEventEvent object to examine
dojo.isDescendant
Defined by dojo
Returns Boolean
Returns true if node is a descendant of ancestor
ParameterTypeDescription
nodeDomNode|Stringstring id or node reference to test
ancestorDomNode|Stringstring id or node reference of potential parent to test against
Example 1
Test is node id="bar" is a descendant of node id="foo"
	if(dojo.isDescendant("bar", "foo")){ ... }
dojo.isFunction
Defined by dojo
Return true if it is a Function
ParameterTypeDescription
itanything
dojo.isObject
Defined by dojo
Returns true if it is a JavaScript object (or an Array, a Function or null)
ParameterTypeDescription
itanything
dojo.isString
Defined by dojo
Returns Boolean
Return true if it is a String
ParameterTypeDescription
itanything
dojo.lastIndexOf
Defined by dojo
Returns Number

This method corresponds to the JavaScript 1.6 Array.lastIndexOf method, with one difference: when run over sparse arrays, the Dojo function invokes the callback for every index whereas JavaScript 1.6's lastIndexOf skips the holes in the sparse array. For details on this method, see: https://developer.mozilla.org/en/CoreJavaScript1.5_Reference/Objects/Array/lastIndexOf

ParameterTypeDescription
arrayArray
valueObject
fromIndexInteger
Optional.
dojo.loadInit
Defined by dojo

This function is mainly a marker for the xdomain loader to know parts of code that needs be executed outside the function wrappper that is placed around modules. The init function could be executed more than once, and it should make no assumptions on what is loaded, or what modules are available. Only the functionality in Dojo Base is allowed to be used. Avoid using this method. For a valid use case, see the source for dojox.gfx.

ParameterTypeDescription
initFunctiona function reference. Executed immediately.
dojo.loaded
Defined by dojo
signal fired when initial environment and package loading is complete. You should use dojo.addOnLoad() instead of doing a direct dojo.connect() to this method in order to handle initialization tasks that require the environment to be initialized. In a browser host, declarative widgets will be constructed when this function finishes runing.
dojo.map
Defined by dojo
Returns Array

This function corresponds to the JavaScript 1.6 Array.map() method, with one difference: when run over sparse arrays, this implemenation passes the "holes" in the sparse array to the callback function with a value of undefined. JavaScript 1.6's map skips the holes in the sparse array. For more details, see: https://developer.mozilla.org/en/CoreJavaScript1.5_Reference/Objects/Array/map

ParameterTypeDescription
arrArray|Stringthe array to iterate on. If a string, operates on individual characters.
callbackFunction|Stringa function is invoked with three arguments, (item, index, array), and returns a value
thisObjectFunction
Optional.
may be used to scope the call to callback
Example 1
	// returns [2, 3, 4, 5]
	dojo.map([1, 2, 3, 4], function(item){ return item+1 });
dojo.marginBox
Defined by dojo
Returns Object

Getter/setter for the margin-box of node. Returns an object in the expected format of box (regardless if box is passed). The object might look like: { l: 50, t: 200, w: 300: h: 150 } for a node offset from its parent 50px to the left, 200px from the top with a margin width of 300px and a margin-height of 150px.

ParameterTypeDescription
nodeDomNode|Stringid or reference to DOM Node to get/set box for
boxObject
Optional.
If passed, denotes that dojo.marginBox() should update/set the margin box for node. Box is an object in the above format. All properties are optional if passed.
Example 1
Retrieve the marginbox of a passed node
	var box = dojo.marginBox("someNodeId");
	console.dir(box);
Example 2
Set a node's marginbox to the size of another node
	var box = dojo.marginBox("someNodeId");
	dojo.marginBox("someOtherNode", box);
dojo.mixin
Defined by dojo
Returns Object

dojo.mixin can mix multiple source objects into a destination object which is then returned. Unlike regular for...in iteration, dojo.mixin is also smart about avoiding extensions which other toolkits may unwisely add to the root object prototype

ParameterTypeDescription
objObjectThe object to mix properties into. Also the return value.
propsObject
One or more can be passed.
One or more objects whose values are successively copied into obj. If more than one of these objects contain the same value, the one specified last in the function call will "win".
Example 1
make a shallow copy of an object
	var copy = dojo.mixin({}, source);
Example 2
many class constructors often take an object which specifies values to be configured on the object. In this case, it is often simplest to call `dojo.mixin` on the `this` object:
	dojo.declare("acme.Base", null, {
		constructor: function(properties){
			// property configuration:
			dojo.mixin(this, properties);
			console.log(this.quip);
			//  ...
		},
		quip: "I wasn't born yesterday, you know - I've seen movies.",
		// ...
	});
	// create an instance of the class and configure it
	var b = new acme.Base({quip: "That's what it does!" });
Example 3
copy in properties from multiple objects
	var flattened = dojo.mixin(
		{
			name: "Frylock",
			braces: true
		},
		{
			name: "Carl Brutanananadilewski"
		}
	);
	// will print "Carl Brutanananadilewski"
	console.log(flattened.name);
	// will print "true"
	console.log(flattened.braces);
dojo.moduleUrl
Defined by dojo
Returns dojo._Url
Returns a dojo._Url object relative to a module.
ParameterTypeDescription
moduleString
urldojo._Url||String
Example 1
	var pngPath = dojo.moduleUrl("acme","images/small.png");
	console.dir(pngPath); // list the object properties
	// create an image and set it's source to pngPath's value:
	var img = document.createElement("img");
	// NOTE: we assign the string representation of the url object
	img.src = pngPath.toString();
	// add our image to the document
	dojo.body().appendChild(img);
Example 2
you may de-reference as far as you like down the package hierarchy. This is sometimes handy to avoid lenghty relative urls or for building portable sub-packages. In this example, the `acme.widget` and `acme.util` directories may be located under different roots (see `dojo.registerModulePath`) but the the modules which reference them can be unaware of their relative locations on the filesystem:
	// somewhere in a configuration block
	dojo.registerModulePath("acme.widget", "../../acme/widget");
	dojo.registerModulePath("acme.util", "../../util");
	// ...
	// code in a module using acme resources
	var tmpltPath = dojo.moduleUrl("acme.widget","templates/template.html");
	var dataPath = dojo.moduleUrl("acme.util","resources/data.json");
dojo.objectToQuery
Defined by dojo
Returns String
takes a name/value mapping object and returns a string representing a URL-encoded version of that object.
ParameterTypeDescription
mapObject
Example 1
this object:
	{
		blah: "blah",
		multi: [
			"thud",
			"thonk"
		]
	};
yields the following query string:
	"blah=blah&multi=thud&multi=thonk"
dojo.partial
Defined by dojo
Returns Function

Calling dojo.partial is the functional equivalent of calling: dojo.hitch(null, funcName, ...);

ParameterTypeDescription
methodFunction|String
dojo.place
Defined by dojo
Returns DomNode: DomNode Returned values is the first argument resolved to a DOM node. .place() is also a method of `dojo.NodeList`, allowing `dojo.query` node lookups.
Attempt to insert node into the DOM, choosing from various positioning options. Returns the first argument resolved to a DOM node.
ParameterTypeDescription
nodeString|DomNodeid or node reference, or HTML fragment starting with "<" to place relative to refNode
refNodeString|DomNodeid or node reference to use as basis for placement
positionString|Number
Optional.
string noting the position of node relative to refNode or a number indicating the location in the childNodes collection of refNode. Accepted string values are: * before * after * replace * only * first * last "first" and "last" indicate positions as children of refNode, "replace" replaces refNode, "only" replaces all children. position defaults to "last" if not specified
Example 1
Place a node by string id as the last child of another node by string id:
	dojo.place("someNode", "anotherNode");
Example 2
Place a node by string id before another node by string id
	dojo.place("someNode", "anotherNode", "before");
Example 3
Create a Node, and place it in the body element (last child):
	dojo.place("<div></div>", dojo.body());
Example 4
Put a new LI as the first child of a list by id:
	dojo.place("<li></li>", "someUl", "first");
dojo.platformRequire
Defined by dojo

This method takes a "map" of arrays which one can use to optionally load dojo modules. The map is indexed by the possible dojo.name_ values, with two additional values: "default" and "common". The items in the "default" array will be loaded if none of the other items have been choosen based on dojo.name_, set by your host environment. The items in the

"common" array will always be loaded, regardless of which list is chosen.

ParameterTypeDescription
modMapObject
Example 1
	dojo.platformRequire({
		browser: [
			"foo.sample", // simple module
			"foo.test",
			["foo.bar.baz", true] // skip object check in _loadModule (dojo.require)
		],
		default: [ "foo.sample._base" ],
		common: [ "important.module.common" ]
	});
dojo.popContext
Defined by dojo
If the context stack contains elements, ensure that subsequent code executes in the *previous* context to the current context. The current context set ([global, document]) is returned.
dojo.position
Defined by dojo
Returns Object

Returns an object of the form: { x: 100, y: 300, w: 20, h: 15 } If includeScroll==true, the x and y values will include any document offsets that may affect the position relative to the viewport. Uses the border-box model (inclusive of border and padding but not margin). Does not act as a setter.

ParameterTypeDescription
nodeDomNode
includeScrollBoolean
Optional.
dojo.provide
Defined by dojo
Returns Object

Each javascript source file is called a resource. When a resource is loaded by the browser, dojo.provide() registers that it has been loaded. Each javascript source file must have at least one dojo.provide() call at the top of the file, corresponding to the file name. For example, js/dojo/foo.js must have dojo.provide("dojo.foo"); before any calls to dojo.require() are made. For backwards compatibility reasons, in addition to registering the resource, dojo.provide() also ensures that the javascript object for the module exists. For example, dojo.provide("dojox.data.FlickrStore"), in addition to registering that FlickrStore.js is a resource for the dojox.data module, will ensure that the dojox.data javascript object exists, so that calls like dojo.data.foo = function(){ ... } don't fail. In the case of a build where multiple javascript source files are combined into one bigger file (similar to a .lib or .jar file), that file may contain multiple dojo.provide() calls, to note that it includes multiple resources.

ParameterTypeDescription
resourceNameStringA dot-sperated string identifying a resource.
Example 1
Safely create a `my` object, and make dojo.require("my.CustomModule") work
	dojo.provide("my.CustomModule");
dojo.pushContext
Defined by dojo
Returns Array

dojo.pushContext treats contexts as a stack. The auto-detected contexts which are initially provided using dojo.setContext() require authors to keep state in order to "return" to a previous context, whereas the dojo.pushContext and dojo.popContext methods provide a more natural way to augment blocks of code to ensure that they execute in a different window or frame without issue. If called without any arguments, the default context (the context when Dojo is first loaded) is instead pushed into the stack. If only a single string is passed, a node in the intitial context's document is looked up and its contextWindow and contextDocument properties are used as the context to push. This means that iframes can be given an ID and code can be executed in the scope of the iframe's document in subsequent calls easily.

ParameterTypeDescription
gObject|String
Optional.
The global context. If a string, the id of the frame to search for a context and document.
dMDocumentElement
Optional.
The document element to execute subsequent code with.
dojo.queryToObject
Defined by dojo
Returns Object
Create an object representing a de-serialized query section of a URL. Query keys with multiple values are returned in an array.
ParameterTypeDescription
strString
Example 1
This string:
		"foo=bar&foo=baz&thinger=%20spaces%20=blah&zonk=blarg&"
results in this object structure:
		{
			foo: [ "bar", "baz" ],
			thinger: " spaces =blah",
			zonk: "blarg"
		}
Note that spaces and other urlencoded entities are correctly
handled.
dojo.rawXhrPost
Defined by dojo
dojo.rawXhrPut
Defined by dojo
dojo.ready
Defined by dojo
dojo.registerModulePath
Defined by dojo

An unregistered module is given the default path of ../[module], relative to Dojo root. For example, module acme is mapped to ../acme. If you want to use a different module name, use dojo.registerModulePath.

ParameterTypeDescription
moduleString
prefixString
Example 1
If your dojo.js is located at this location in the web root:
	/myapp/js/dojo/dojo/dojo.js
and your modules are located at:
	/myapp/js/foo/bar.js
	/myapp/js/foo/baz.js
	/myapp/js/foo/thud/xyzzy.js
Your application can tell Dojo to locate the "foo" namespace by calling:
	dojo.registerModulePath("foo", "../../foo");
At which point you can then use dojo.require() to load the modules (assuming they provide() the same things which are required). The full code might be:
		dojo.registerModulePath("foo", "../../foo");
		dojo.require("foo.bar");
		dojo.require("foo.baz");
		dojo.require("foo.thud.xyzzy");
dojo.removeAttr
Defined by dojo
Removes an attribute from an HTML element.
ParameterTypeDescription
nodeDomNode|Stringid or reference to the element to remove the attribute from
nameStringthe name of the attribute to remove
dojo.removeClass
Defined by dojo
Removes the specified classes from node. No dojo.hasClass check is required.
ParameterTypeDescription
nodeDomNode|StringString ID or DomNode reference to remove the class from.
classStrString|Array
Optional.
An optional String class name to remove, or several space-separated class names, or an array of class names. If omitted, all class names will be deleted.
Example 1
Remove a class from some node:
	dojo.removeClass("someNode", "firstClass");
Example 2
Remove two classes from some node:
	dojo.removeClass("someNode", "firstClass secondClass");
Example 3
Remove two classes from some node (using array):
	dojo.removeClass("someNode", ["firstClass", "secondClass"]);
Example 4
Remove all classes from some node:
	dojo.removeClass("someNode");
Example 5
Available in `dojo.NodeList()` for multiple removal
	dojo.query(".foo").removeClass("foo");
dojo.replace
Defined by dojo
Returns String: String Returns the substituted string.
Performs parameterized substitutions on a string. Throws an exception if any parameter is unmatched.
ParameterTypeDescription
tmplStringString to be used as a template.
mapObject|FunctionIf an object, it is used as a dictionary to look up substitutions. If a function, it is called for every substitution with following parameters: a whole match, a name, an offset, and the whole template string (see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/replace for more details).
patternRegEx
Optional.
Optional regular expression objects that overrides the default pattern. Must be global and match one item. The default is: /\{([^\}]+)\}/g, which matches patterns like that: "{xxx}", where "xxx" is any sequence of characters, which doesn't include "}".
Example 1
	// uses a dictionary for substitutions:
	dojo.replace("Hello, {name.first} {name.last} AKA {nick}!",
	  {
	    nick: "Bob",
	    name: {
	      first:  "Robert",
	      middle: "X",
	      last:   "Cringely"
	    }
	  });
	// returns: Hello, Robert Cringely AKA Bob!
Example 2
	// uses an array for substitutions:
	dojo.replace("Hello, {0} {2}!",
	  ["Robert", "X", "Cringely"]);
	// returns: Hello, Robert Cringely!
Example 3
	// uses a function for substitutions:
	function sum(a){
	  var t = 0;
	  dojo.forEach(a, function(x){ t += x; });
	  return t;
	}
	dojo.replace(
	  "{count} payments averaging {avg} USD per payment.",
	  dojo.hitch(
	    { payments: [11, 16, 12] },
	    function(_, key){
	      switch(key){
	        case "count": return this.payments.length;
	        case "min":   return Math.min.apply(Math, this.payments);
	        case "max":   return Math.max.apply(Math, this.payments);
	        case "sum":   return sum(this.payments);
	        case "avg":   return sum(this.payments) / this.payments.length;
	      }
	    }
	  )
	);
	// prints: 3 payments averaging 13 USD per payment.
Example 4
	// uses an alternative PHP-like pattern for substitutions:
	dojo.replace("Hello, ${0} ${2}!",
	  ["Robert", "X", "Cringely"], /\$\{([^\}]+)\}/g);
	// returns: Hello, Robert Cringely!
dojo.require
Defined by dojo
the required namespace object

Modules are loaded via dojo.require by using one of two loaders: the normal loader and the xdomain loader. The xdomain loader is used when dojo was built with a custom build that specified loader=xdomain and the module lives on a modulePath that is a whole URL, with protocol and a domain. The versions of Dojo that are on the Google and AOL CDNs use the xdomain loader. If the module is loaded via the xdomain loader, it is an asynchronous load, since the module is added via a dynamically created script tag. This means that dojo.require() can return before the module has loaded. However, this should only happen in the case where you do dojo.require calls in the top-level HTML page, or if you purposely avoid the loader checking for dojo.require dependencies in your module by using a syntax like dojo["require"] to load the module. Sometimes it is useful to not have the loader detect the dojo.require calls in the module so that you can dynamically load the modules as a result of an action on the page, instead of right at module load time. Also, for script blocks in an HTML page, the loader does not pre-process them, so it does not know to download the modules before the dojo.require calls occur. So, in those two cases, when you want on-the-fly module loading or for script blocks in the HTML page, special care must be taken if the dojo.required code is loaded asynchronously. To make sure you can execute code that depends on the dojo.required modules, be sure to add the code that depends on the modules in a dojo.addOnLoad() callback. dojo.addOnLoad waits for all outstanding modules to finish loading before executing.

Example:

    <script type="text/javascript">
    dojo.require("foo");
    dojo.require("bar");
    dojo.addOnLoad(function(){
        //you can now safely do something with foo and bar
    });
	</script>
This type of syntax works with both xdomain and normal loaders, so it is good practice to always use this idiom for on-the-fly code loading and in HTML script blocks. If at some point you change loaders and where the code is loaded from, it will all still work. More on how dojo.require dojo.require("A.B") first checks to see if symbol A.B is defined. If it is, it is simply returned (nothing to do). If it is not defined, it will look for A/B.js in the script root directory. dojo.require throws an excpetion if it cannot find a file to load, or if the symbol A.B is not defined after loading. It returns the object A.B, but note the caveats above about on-the-fly loading and HTML script blocks when the xdomain loader is loading a module. dojo.require() does nothing about importing symbols into the current namespace. It is presumed that the caller will take care of that. For example, to import all symbols into a local block, you might write: with (dojo.require("A.B")) { ... } And to import just the leaf symbol to a local variable: var B = dojo.require("A.B"); ...

ParameterTypeDescription
moduleNameStringmodule name to load, using periods for separators, e.g. "dojo.date.locale". Module paths are de-referenced by dojo's internal mapping of locations to names and are disambiguated by longest prefix. See dojo.registerModulePath() for details on registering new modules.
omitModuleCheckBoolean
Optional.
if true, omitModuleCheck skips the step of ensuring that the loaded file actually defines the symbol it is referenced by. For example if it called as dojo.require("a.b.c") and the file located at a/b/c.js does not define an object a.b.c, and exception will be throws whereas no exception is raised when called as dojo.require("a.b.c", true)
dojo.requireIf
Defined by dojo
If the condition is true then call dojo.require() for the specified resource
ParameterTypeDescription
conditionBoolean
resourceNameString
Example 1
	dojo.requireIf(dojo.isBrowser, "my.special.Module");
dojo.requireLocalization
Defined by dojo

Load translated resource bundles provided underneath the "nls" directory within a package. Translated resources may be located in different packages throughout the source tree. Each directory is named for a locale as specified by RFC 3066, (http://www.ietf.org/rfc/rfc3066.txt), normalized in lowercase. Note that the two bundles in the example do not define all the same variants. For a given locale, bundles will be loaded for that locale and all more general locales above it, including a fallback at the root directory. For example, a declaration for the "de-at" locale will first load nls/de-at/bundleone.js, then nls/de/bundleone.js and finally nls/bundleone.js. The data will be flattened into a single Object so that lookups will follow this cascading pattern. An optional build step can preload the bundles to avoid data redundancy and the multiple network hits normally required to load these resources.

ParameterTypeDescription
moduleNameStringname of the package containing the "nls" directory in which the bundle is found
bundleNameStringbundle name, i.e. the filename without the '.js' suffix. Using "nls" as a a bundle name is not supported, since "nls" is the name of the folder that holds bundles. Using "nls" as the bundle name will cause problems with the custom build.
localeString
Optional.
the locale to load (optional) By default, the browser's user locale as defined by dojo.locale
availableFlatLocalesString
Optional.
A comma-separated list of the available, flattened locales for this bundle. This argument should only be set by the build process.
Example 1
A particular widget may define one or more resource bundles, structured in a program as follows, where moduleName is mycode.mywidget and bundleNames available include bundleone and bundletwo:
		...
	mycode/
		mywidget/
			nls/
				bundleone.js (the fallback translation, English in this example)
				bundletwo.js (also a fallback translation)
				de/
					bundleone.js
					bundletwo.js
				de-at/
					bundleone.js
				en/
					(empty; use the fallback translation)
				en-us/
					bundleone.js
				en-gb/
					bundleone.js
				es/
					bundleone.js
					bundletwo.js
				  ...etc
				...
dojo.safeMixin
Defined by dojo

This function is used to mix in properties like dojo._mixin does, but it skips a constructor property and decorates functions like dojo.declare does. It is meant to be used with classes and objects produced with dojo.declare. Functions mixed in with dojo.safeMixin can use this.inherited() like normal methods. This function is used to implement extend() method of a constructor produced with dojo.declare().

ParameterTypeDescription
targetObjectTarget object to accept new properties.
sourceObjectSource object for new properties.
Example 1
	var A = dojo.declare(null, {
		m1: function(){
			console.log("A.m1");
		},
		m2: function(){
			console.log("A.m2");
		}
	});
	var B = dojo.declare(A, {
		m1: function(){
			this.inherited(arguments);
			console.log("B.m1");
		}
	});
	B.extend({
		m2: function(){
			this.inherited(arguments);
			console.log("B.m2");
		}
	});
	var x = new B();
	dojo.safeMixin(x, {
		m1: function(){
			this.inherited(arguments);
			console.log("X.m1");
		},
		m2: function(){
			this.inherited(arguments);
			console.log("X.m2");
		}
	});
	x.m2();
	// prints:
	// A.m1
	// B.m1
	// X.m1
dojo.setContext
Defined by dojo
changes the behavior of many core Dojo functions that deal with namespace and DOM lookup, changing them to work in a new global context (e.g., an iframe). The varibles dojo.global and dojo.doc are modified as a result of calling this function and the result of dojo.body() likewise differs.
ParameterTypeDescription
globalObjectObject
globalDocumentDocumentElement
dojo.setObject
Defined by dojo
Returns Object

Useful for longer api chains where you have to test each object in the chain, or when you have an object reference in string format. Objects are created as needed along path. Returns the passed value if setting is successful or undefined if not.

ParameterTypeDescription
nameStringPath to a property, in the form "A.B.C".
valueObject
contextObject
Optional.
Optional. Object to use as root of path. Defaults to dojo.global.
Example 1
set the value of `foo.bar.baz`, regardless of whether intermediate objects already exist:
	dojo.setObject("foo.bar.baz", value);
Example 2
without `dojo.setObject`, we often see code like this:
	// ensure that intermediate objects are available
	if(!obj["parent"]){ obj.parent = {}; }
	if(!obj.parent["child"]){ obj.parent.child= {}; }
	// now we can safely set the property
	obj.parent.child.prop = "some value";
wheras with `dojo.setObject`, we can shorten that to:
	dojo.setObject("parent.child.prop", "some value", obj);
dojo.setSelectable
Defined by dojo
Enable or disable selection on a node
ParameterTypeDescription
nodeDomNode|Stringid or reference to node
selectableBooleanstate to put the node in. false indicates unselectable, true allows selection.
Example 1
Make the node id="bar" unselectable
	dojo.setSelectable("bar");
Example 2
Make the node id="bar" selectable
	dojo.setSelectable("bar", true);
dojo.some
Defined by dojo
Returns Boolean

This function corresponds to the JavaScript 1.6 Array.some() method, with one difference: when run over sparse arrays, this implemenation passes the "holes" in the sparse array to the callback function with a value of undefined. JavaScript 1.6's some skips the holes in the sparse array. For more details, see: https://developer.mozilla.org/en/CoreJavaScript1.5_Reference/Objects/Array/some

ParameterTypeDescription
arrArray|Stringthe array to iterate over. If a string, operates on individual characters.
callbackFunction|Stringa function is invoked with three arguments: item, index, and array and returns true if the condition is met.
thisObjectObject
Optional.
may be used to scope the call to callback
Example 1
	// is true
	dojo.some([1, 2, 3, 4], function(item){ return item>1; });
Example 2
	// is false
	dojo.some([1, 2, 3, 4], function(item){ return item<1; });
dojo.stopEvent
Defined by dojo
prevents propagation and clobbers the default action of the passed event
ParameterTypeDescription
evtEventThe event object. If omitted, window.event is used on IE.
dojo.style
Defined by dojo

Getting the style value uses the computed style for the node, so the value will be a calculated value, not just the immediate node.style value. Also when getting values, use specific style names, like "borderBottomWidth" instead of "border" since compound values like "border" are not necessarily reflected as expected. If you want to get node dimensions, use dojo.marginBox(), dojo.contentBox() or dojo.position().

ParameterTypeDescription
nodeDomNode|Stringid or reference to node to get/set style for
styleString|Object
Optional.
the style property to set in DOM-accessor format ("borderWidth", not "border-width") or an object with key/value pairs suitable for setting each property.
valueString
Optional.
If passed, sets value on the node for style, handling cross-browser concerns. When setting a pixel value, be sure to include "px" in the value. For instance, top: "200px". Otherwise, in some cases, some browsers will not apply the style.
Example 1
Passing only an ID or node returns the computed style object of the node:
	dojo.style("thinger");
Example 2
Passing a node and a style property returns the current normalized, computed value for that property:
	dojo.style("thinger", "opacity"); // 1 by default
Example 3
Passing a node, a style property, and a value changes the current display of the node and returns the new computed value
	dojo.style("thinger", "opacity", 0.5); // == 0.5
Example 4
Passing a node, an object-style style property sets each of the values in turn and returns the computed style object of the node:
	dojo.style("thinger", {
		"opacity": 0.5,
		"border": "3px solid black",
		"height": "300px"
	});
Example 5
When the CSS style property is hyphenated, the JavaScript property is camelCased. font-size becomes fontSize, and so on.
	dojo.style("thinger",{
		fontSize:"14pt",
		letterSpacing:"1.2em"
	});
Example 6
dojo.NodeList implements .style() using the same syntax, omitting the "node" parameter, calling dojo.style() on every element of the list. See: `dojo.query()` and `dojo.NodeList()`
	dojo.query(".someClassName").style("visibility","hidden");
	// or
	dojo.query("#baz > div").style({
		opacity:0.75,
		fontSize:"13pt"
	});
dojo.toJson
Defined by dojo
Returns null|String

Returns a JSON serialization of an object. Note that this doesn't check for infinite recursion, so don't do that!

ParameterTypeDescription
itObjectan object to be serialized. Objects may define their own serialization via a special "__json__" or "json" function property. If a specialized serializer has been defined, it will be used as a fallback.
prettyPrintBoolean
Optional.
if true, we indent objects and arrays to make the output prettier. The variable dojo.toJsonIndentStr is used as the indent string -- to use something other than the default (tab), change that variable before calling dojo.toJson().
_indentStrString
Optional.
private variable for recursive calls when pretty printing, do not use.
Example 1
simple serialization of a trivial object
	var jsonStr = dojo.toJson({ howdy: "stranger!", isStrange: true });
	doh.is('{"howdy":"stranger!","isStrange":true}', jsonStr);
Example 2
a custom serializer for an objects of a particular class:
	dojo.declare("Furby", null, {
		furbies: "are strange",
		furbyCount: 10,
		__json__: function(){
		},
	});
dojo.toggleClass
Defined by dojo
Adds a class to node if not present, or removes if present. Pass a boolean condition if you want to explicitly add or remove.
ParameterTypeDescription
nodeDomNode|String
classStrString|Array
conditionBoolean
Optional.
If passed, true means to add the class, false means to remove.
Example 1
	dojo.toggleClass("someNode", "hovered");
Example 2
Forcefully add a class
	dojo.toggleClass("someNode", "hovered", true);
Example 3
Available in `dojo.NodeList()` for multiple toggles
	dojo.query(".toggleMe").toggleClass("toggleMe");
dojo.trim
Defined by dojo
Returns String: String Returns the trimmed string

This version of trim() was selected for inclusion into the base due to its compact size and relatively good performance (see Steven Levithan's blog Uses String.prototype.trim instead, if available. The fastest but longest version of this function is located at dojo.string.trim()

ParameterTypeDescription
strStringString to be trimmed
dojo.unloaded
Defined by dojo
signal fired by impending environment destruction. You should use dojo.addOnUnload() instead of doing a direct dojo.connect() to this method to perform page/application cleanup methods. See dojo.addOnUnload for more info.
dojo.when
Defined by dojo
This provides normalization between normal synchronous values and asynchronous promises, so you can interact with them in a common way
ParameterTypeDescription
promiseOrValue
callbackFunction
Optional.
errbackFunction
Optional.
progressHandlerFunction
Optional.
Example 1
	function printFirstAndList(items){
		dojo.when(findFirst(items), console.log);
		dojo.when(findLast(items), console.log);
	}
	function findFirst(items){
		return dojo.when(items, function(items){
			return items[0];
		});
	}
	function findLast(items){
		return dojo.when(items, function(items){
			return items[items.length];
		});
	}
And now all three of his functions can be used sync or async.
	printFirstAndLast([1,2,3,4]) will work just as well as
	printFirstAndLast(dojo.xhrGet(...));
dojo.windowUnloaded
Defined by dojo
signal fired by impending window destruction. You may use dojo.addOnWIndowUnload() or dojo.connect() to this method to perform page/application cleanup methods. See dojo.addOnWindowUnload for more info.
dojo.withDoc
Defined by dojo

Invoke callback with documentObject as dojo.doc. If provided, callback will be executed in the context of object thisObject When callback() returns or throws an error, the dojo.doc will be restored to its previous state.

ParameterTypeDescription
documentObjectDocumentElement
callbackFunction
thisObjectObject
Optional.
cbArgumentsArray
Optional.
dojo.withGlobal
Defined by dojo

Invoke callback with globalObject as dojo.global and globalObject.document as dojo.doc. If provided, globalObject will be executed in the context of object thisObject When callback() returns or throws an error, the dojo.global and dojo.doc will be restored to its previous state.

ParameterTypeDescription
globalObjectObject
callbackFunction
thisObjectObject
Optional.
cbArgumentsArray
Optional.
dojo.xdRequireLocalization
Defined by dojo
Internal xd loader function. The xd version of dojo.requireLocalization.
ParameterTypeDescription
m
b
localeString
Optional.
fLocales
moduleNameString
bundleNameString
availableFlatLocalesString
dojo.xhr
Defined by dojo
Returns dojo.Deferred

Sends an HTTP request with the given method. See also dojo.xhrGet(), xhrPost(), xhrPut() and dojo.xhrDelete() for shortcuts for those HTTP methods. There are also methods for "raw" PUT and POST methods via dojo.rawXhrPut() and dojo.rawXhrPost() respectively.

ParameterTypeDescription
methodStringHTTP method to be used, such as GET, POST, PUT, DELETE. Should be uppercase.
argsdojo.__XhrArgs
ParameterTypeDescription
handleAsString

Acceptable values are: text (default), json, json-comment-optional, json-comment-filtered, javascript, xml. See dojo.contentHandlers

syncBoolean

false is default. Indicates whether the request should be a synchronous (blocking) request.

headersObject

Additional HTTP headers to send in the request.

failOkBoolean

false is default. Indicates whether a request should be allowed to fail (and therefore no console error message in the event of a failure)

hasBodyBoolean
Optional.
If the request has an HTTP body, then pass true for hasBody.
dojo.xhrDelete
Defined by dojo
Returns dojo.Deferred
Sends an HTTP DELETE request to the server.
ParameterTypeDescription
argsdojo.__XhrArgs
ParameterTypeDescription
handleAsString

Acceptable values are: text (default), json, json-comment-optional, json-comment-filtered, javascript, xml. See dojo.contentHandlers

syncBoolean

false is default. Indicates whether the request should be a synchronous (blocking) request.

headersObject

Additional HTTP headers to send in the request.

failOkBoolean

false is default. Indicates whether a request should be allowed to fail (and therefore no console error message in the event of a failure)

dojo.xhrGet
Defined by dojo
Returns dojo.Deferred
Sends an HTTP GET request to the server.
ParameterTypeDescription
argsdojo.__XhrArgs
ParameterTypeDescription
handleAsString

Acceptable values are: text (default), json, json-comment-optional, json-comment-filtered, javascript, xml. See dojo.contentHandlers

syncBoolean

false is default. Indicates whether the request should be a synchronous (blocking) request.

headersObject

Additional HTTP headers to send in the request.

failOkBoolean

false is default. Indicates whether a request should be allowed to fail (and therefore no console error message in the event of a failure)

dojo.xhrPost
Defined by dojo
Returns dojo.Deferred
Sends an HTTP POST request to the server. In addtion to the properties listed for the dojo.__XhrArgs type, the following property is allowed: postData: String. Send raw data in the body of the POST request.
ParameterTypeDescription
argsdojo.__XhrArgs
ParameterTypeDescription
handleAsString

Acceptable values are: text (default), json, json-comment-optional, json-comment-filtered, javascript, xml. See dojo.contentHandlers

syncBoolean

false is default. Indicates whether the request should be a synchronous (blocking) request.

headersObject

Additional HTTP headers to send in the request.

failOkBoolean

false is default. Indicates whether a request should be allowed to fail (and therefore no console error message in the event of a failure)

dojo.xhrPut
Defined by dojo
Returns dojo.Deferred
Sends an HTTP PUT request to the server. In addtion to the properties listed for the dojo.__XhrArgs type, the following property is allowed: putData: String. Send raw data in the body of the PUT request.
ParameterTypeDescription
argsdojo.__XhrArgs
ParameterTypeDescription
handleAsString

Acceptable values are: text (default), json, json-comment-optional, json-comment-filtered, javascript, xml. See dojo.contentHandlers

syncBoolean

false is default. Indicates whether the request should be a synchronous (blocking) request.

headersObject

Additional HTTP headers to send in the request.

failOkBoolean

false is default. Indicates whether a request should be allowed to fail (and therefore no console error message in the event of a failure)

Events

dojo._onto
Defined by dojo
ParameterTypeDescription
arr
obj
fn

Comments