HOME

TheInfoList



OR:

Dojo Toolkit (stylized as dōjō toolkit) is an
open-source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized so ...
modular
JavaScript library A JavaScript library is a library of pre-written JavaScript code that allows for easier development of JavaScript-based applications, especially for AJAX and other web-centric technologies. Libraries With the expanded demands for JavaScript, an ea ...
(or more specifically
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
toolkit) designed to ease the rapid development of cross-platform, JavaScript/
Ajax Ajax may refer to: Greek mythology and tragedy * Ajax the Great, a Greek mythological hero, son of King Telamon and Periboea * Ajax the Lesser, a Greek mythological hero, son of Oileus, the king of Locris * ''Ajax'' (play), by the ancient Gree ...
-based applications and web sites. It was started by Alex Russell, Dylan Schiemann, David Schontzler, and others in 2004A Brief History of Dojo
/ref> and is dual-licensed under the
modified BSD license BSD licenses are a family of permissive free software licenses, imposing minimal restrictions on the use and distribution of covered software. This is in contrast to copyleft licenses, which have share-alike requirements. The original BSD lice ...
or the
Academic Free License The Academic Free License (AFL) is a permissive free software license written in 2002 by Lawrence E. Rosen, a former general counsel of the Open Source Initiative (OSI). The license grants similar rights to the BSD, MIT, UoI/NCSA and Apach ...
(≥ 2.1). The Dojo Foundation was a non-profit organization created with the goal to promote the adoption of the toolkit. In 2016, the foundation merged with
jQuery jQuery is a JavaScript library designed to simplify HTML DOM tree traversal and manipulation, as well as event handling, CSS animation, and Ajax. It is free, open-source software using the permissive MIT License. As of Aug 2022, jQuery is u ...
Foundation to become
JS Foundation The OpenJS Foundation is an organization that was founded in 2019 from a merger of JS Foundation and Node.js Foundation. OpenJS Promotes the JavaScript and web ecosystem by hosting projects and funds activities that benefit the ecosystem. The OpenJ ...
.


Overview

Dojo is a
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
framework targeting the many needs of large-scale client-side web development. For example, Dojo abstracts the differences among diverse browsers to provide APIs that will work on all of them (it can even run on the server under
Node.js Node.js is an open-source server environment. Node.js is cross-platform and runs on Windows, Linux, Unix, and macOS. Node.js is a back-end JavaScript runtime environment. Node.js runs on the V8 JavaScript Engine and executes JavaScript cod ...
); it establishes a framework for defining modules of code and managing their interdependencies; it provides build tools for optimizing JavaScript and
CSS Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language such as HTML or XML (including XML dialects such as SVG, MathML or XHTML). CSS is a cornerstone technolo ...
, generating documentation, and unit testing; it supports internationalization, localization, and
accessibility Accessibility is the design of products, devices, services, vehicles, or environments so as to be usable by people with disabilities. The concept of accessible design and practice of accessible development ensures both "direct access" (i. ...
; and it provides a rich suite of commonly needed utility classes and user-interface widgets. Dojo is completely open-source. The entire toolkit can b
downloaded
as a ZIP and is also hosted on th
Google CDN
The toolkit includes about three thousand JavaScript modules, in addition to images and other resources. The Dojo Toolkit is organized in several parts: * dojo contains the core and most non-visual modules. * dijit is a library of user-interface modules for widgets and layout. * dojox holds assorted modules not yet considered stable enough to include in ''dojo'' or ''dijit''. * util includes build tools such as optimization, documentation, style-checking, and testing.


Features


Widgets

Dojo widgets are components — comprising
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
code,
HTML The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaS ...
markup, and
CSS Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language such as HTML or XML (including XML dialects such as SVG, MathML or XHTML). CSS is a cornerstone technolo ...
style declarations — that provide multi-browser (not to be confused with cross-browser), interactive features: *
Menu In a restaurant, the menu is a list of food and beverages offered to customers and the prices. A menu may be à la carte – which presents a list of options from which customers choose – or table d'hôte, in which case a pre-established seque ...
s, tabs, and
tooltip The tooltip, also known as infotip or hint, is a common graphical user interface (GUI) element in which, when hovering over a screen element or component, a text box displays information about that element, such as a description of a button's f ...
s * Sortable tables * Dynamic charts * 2D vector drawings * Animated effects—fades, wipes and slides—facilities for custom animation effects


Asynchronous communication

One important feature of Ajax applications is asynchronous communication of the browser with the server: information is exchanged and the page's presentation is updated without a need for reloading the whole page. Traditionally, this is done with the JavaScript object
XMLHttpRequest XMLHttpRequest (XHR) is an API in the form of an object whose methods transfer data between a web browser and a web server. The object is provided by the browser's JavaScript environment. Particularly, retrieval of data from XHR for the purpos ...
. Dojo provides an abstracted wrapper (dojo.xhr) around various web browsers' implementations of XMLHttpRequest, and dojo.io also supports other transports (such as hidden IFrames) and a variety of data formats. Using this approach, it is easy to have the data a user enters into a form sent to the server "behind the scenes"; the server can then reply with some JavaScript code that updates the presentation of the page.


Packaging system

Dojo provides a packaging system to facilitate modular development of functionality in individual packages and sub-packages; the base Dojo " bootstrap" script initializes a set of hierarchical package namespaces — "io", "event", etc. — under a root "dojo"
namespace In computing, a namespace is a set of signs (''names'') that are used to identify and refer to objects of various kinds. A namespace ensures that all of a given set of objects have unique names so that they can be easily identified. Namespaces ...
. After initialization of the root namespace, any Dojo package can be loaded (via
XMLHttpRequest XMLHttpRequest (XHR) is an API in the form of an object whose methods transfer data between a web browser and a web server. The object is provided by the browser's JavaScript environment. Particularly, retrieval of data from XHR for the purpos ...
or other similar transport) by using utility functions supplied in the bootstrap. It is also possible to initialize additional namespaces within or parallel to the "dojo" namespace, allowing extensions of Dojo or the development of private Dojo-managed namespaces for third-party libraries and applications. Dojo packages can consist of multiple files and can specify which files constitute the entire package. Any package or file can also specify a dependency on other packages or files; when the package is loaded, any dependencies it specifies will also be loaded.
Workaround A workaround is a bypass of a recognized problem or limitation in a system or policy. A workaround is typically a temporary fix that implies that a genuine solution to the problem is needed. But workarounds are frequently as creative as true solut ...
s for cross-domain loading of most Dojo packages are provided (though this requires a specialized build of Dojo). Dojo also provides a mechanism for building "profiles"; the build system takes as input a list of packages, and uses Rhino to create a single compressed JavaScript file containing those packages and all their dependencies. This allows all necessary code to be loaded and initialized at once, and permits caching of the code (most
web browser A web browser is application software for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's screen. Browsers are used o ...
s do not cache files loaded via XMLHttpRequest). Pre-built profiles for some common use cases are available for download from the same location as the full toolkit.


Client-side data storage

In addition to providing support functions for reading and writing
cookies A cookie is a baked or cooked snack or dessert that is typically small, flat and sweet. It usually contains flour, sugar, egg, and some type of oil, fat, or butter. It may include other ingredients such as raisins, oats, chocolate chi ...
, Dojo formerly supported a local, client-side storage abstraction named Dojo Storage. Dojo Storage allows web applications to store data on the client-side, persistently and securely and with a user's permission. It works across existing web browsers, including
Internet Explorer Internet Explorer (formerly Microsoft Internet Explorer and Windows Internet Explorer, commonly abbreviated IE or MSIE) is a series of graphical web browsers developed by Microsoft which was used in the Windows line of operating systems (in ...
,
Firefox Mozilla Firefox, or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko rendering engine to display web pages, which implements current ...
, and
Safari A safari (; ) is an overland journey to observe wild animals, especially in eastern or southern Africa. The so-called "Big Five" game animals of Africa – lion, leopard, rhinoceros, elephant, and Cape buffalo – particularly form an impor ...
. When included in a web page, Dojo Storage determines the best method for persistently storing information. Firefox 2 uses native browser persistence; on other browsers, it uses a hidden Flash applet. With Flash 6+ being installed on about 95% of computers connected to the web, this makes the storage mechanism accessible for much of the web's installed base. For a web application loaded from the file system, i.e., from a file:// URL, Dojo Storage will transparently use
XPCOM Cross Platform Component Object Model (XPCOM) is a cross-platform component model from Mozilla. It is similar to Microsoft Component Object Model (COM) and Common Object Request Broker Architecture (CORBA). It features multiple language bindings ...
on Firefox and
ActiveX ActiveX is a deprecated software framework created by Microsoft that adapts its earlier Component Object Model (COM) and Object Linking and Embedding (OLE) technologies for content downloaded from a network, particularly from the World Wide We ...
on Internet Explorer to persist information. The programmer using Dojo Storage is abstracted from the storage mechanism used and is presented with a simple
hash table In computing, a hash table, also known as hash map, is a data structure that implements an associative array or dictionary. It is an abstract data type that maps keys to values. A hash table uses a hash function to compute an ''index'', ...
abstraction, with methods such as put() and get(). Dojo Storage is not supported in versions later than the 1.3 release.


Server-side data storage

As of January 2007, Dojo includes the following example
server-side In the client–server model, server-side refers to programs and operations that run on the server. This is in contrast to client-side programs and operations which run on the client. General concepts Typically, a server is a computer applicati ...
datastore implementations in the ''dojo.data'' namespace: * CsvStore: a read-only store that reads tabular data from
comma-separated values A comma-separated values (CSV) file is a delimited text file that uses a comma to separate values. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. The use of the comma as a field separ ...
files * OpmlStore: a read-only store that reads hierarchical data from
OPML OPML (Outline Processor Markup Language) is an XML format for outlines (defined as "a tree, where each node contains a set of named attributes with string values"). Originally developed by UserLand as a native file format for the outliner appl ...
format files * YahooStore: a read-only store that fetches search results from the
Yahoo! Search Yahoo! Search is a Yahoo! internet search provider that uses Microsoft's Microsoft Bing, Bing search engine to power results, since 2009, apart from four years with Google Search, Google until 2019. Originally, "Yahoo! Search" referred to a Yah ...
web service * DeliciousStore: a read-only store that fetches bookmarks from the del.icio.us web service * RdfStore: a read-write store that uses
SPARQL SPARQL (pronounced " sparkle" , a recursive acronym for SPARQL Protocol and RDF Query Language) is an RDF query language—that is, a semantic query language for databases—able to retrieve and manipulate data stored in Resource Description ...
to talk to RDF data servers including, for example, the
Rhizome In botany and dendrology, a rhizome (; , ) is a modified subterranean plant stem that sends out roots and shoots from its nodes. Rhizomes are also called creeping rootstalks or just rootstalks. Rhizomes develop from axillary buds and grow ...
RDF application server.


Support for Adobe Integrated Runtime (AIR)

Dojo can be used in
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
-based
Adobe AIR Adobe AIR (also known as Adobe Integrated Runtime and is codenamed Apollo) is a cross-platform runtime system currently developed by Harman International, in collaboration with Adobe Inc., for building desktop applications and mobile applic ...
applications. It has been modified to meet AIR's security requirements. SitePen, a Dojo consulting company, has made an Adobe AIR application called "Dojo Toolbox" using Dojo. It includes an API viewer and a GUI to Dojo's build system. Normally, the build system is run from within Rhino, but in this AIR application the build system can be run from AIR, without the use of Java.


Release history


Dojo Toolkit

Versions 1.10 through 1.16 continue to receive new point releases as important changes are backported.


Dojo

Version 2.0 was released in 2018. Version 2.0 and later drop the word 'toolkit' from name.


Criticisms


Loading

Earlier versions of Dojo had a reputation for being bulky and slow to load. It also required extra work to load Dojo across domains, e.g., from a CDN. Addressing these problems was the major goal of Dojo 1.7, which introduced asynchronous module definition (AMD) and a "nano" loader.


Documentation

Dojo has long been criticized for its incomplete, scattered, and outdated documentation. Recognizing this, the developers made huge improvements in the documentation for the 1.8 release, including new tutorials, an API browser, filling in the missing pieces, and updating most examples to AMD style. A number of books have been written about Dojo, but all based upon Dojo 1.3 or earlier, now several years out of date. Since these predate AMD support and its accompanying reorganization, examples in these books almost invariably rely on things that are now deprecated and no longer best practice. Most authors are waiting for Dojo 2.0 before publishing anything new.


Learning curve

Many have commented that Dojo seems difficult to learn and get started with, especially in comparison with the more popular
jQuery jQuery is a JavaScript library designed to simplify HTML DOM tree traversal and manipulation, as well as event handling, CSS animation, and Ajax. It is free, open-source software using the permissive MIT License. As of Aug 2022, jQuery is u ...
. Dojo co-creator Dylan Schiemann acknowledges this as a consequence of their different scopes: "It’s certainly easier to learn something that’s smaller than something that does more, but our avid users are quick to point out that a bit more learning up front saves them countless hours for things that Dojo makes easy."


API stabillity

Early users faced a difficult transition to the 1.0 release after the toolkit was totally rewritten. The move to AMD in recent versions has been similarly problematic. Dojo has taken great pains to maintain backward compatibility despite its rapid evolution, with a large portion of the current API deprecated but still maintained, but users have often found that upgrades did not go as smoothly as hoped. Dojo 2.0 release removed much of the deprecated API and switched from JavaScript to TypeScript.


Dojo Foundation and sponsorship

The Dojo Foundation was a
501(c)(6) A 501(c) organization is a nonprofit organization in the federal law of the United States according to Internal Revenue Code (26 U.S.C. § 501(c)) and is one of over 29 types of nonprofit organizations exempt from some federal income taxes ...
non-profit organization A nonprofit organization (NPO) or non-profit organisation, also known as a non-business entity, not-for-profit organization, or nonprofit institution, is a legal entity organized and operated for a collective, public or social benefit, in co ...
founded in 2005 to help open source projects. Its primary goals are to aid in adoption by companies, and encourage projects in the foundation to collaborate with one another.The Dojo Foundation
/ref> Its sponsors and members are: The Dojo Foundation also helps the following projects in addition to the Dojo Toolkit: In 2006, both IBM and
Sun Microsystems Sun Microsystems, Inc. (Sun for short) was an American technology company that sold computers, computer components, software, and information technology services and created the Java programming language, the Solaris operating system, ZFS, t ...
announced official support for Dojo, including code contributions. A Gartner report in 2009 noted that IBM support Dojo across 30 of their products. Zend Technologies, the company behind the PHP core, announced a partnership with Dojo in 2008, incorporating the toolkit into the
Zend Framework Laminas Project (formerly Zend Framework or ZF) is an open source, object-oriented web application framework implemented in PHP 7 and licensed under the New BSD License. The framework is basically a collection of professional PHP-based pac ...
.Dojo and Zend Framework Partnership Announcement
/ref> In 2016, the Dojo Foundation merged with
jQuery jQuery is a JavaScript library designed to simplify HTML DOM tree traversal and manipulation, as well as event handling, CSS animation, and Ajax. It is free, open-source software using the permissive MIT License. As of Aug 2022, jQuery is u ...
Foundation to become
JS Foundation The OpenJS Foundation is an organization that was founded in 2019 from a merger of JS Foundation and Node.js Foundation. OpenJS Promotes the JavaScript and web ecosystem by hosting projects and funds activities that benefit the ecosystem. The OpenJ ...
.


See also

*
Comparison of JavaScript frameworks This is a comparison of web frameworks for front-end web development Front-end web development is the development of the graphical user interface of a website, through the use of HTML, CSS, and JavaScript, so that users can view an ...
*
JavaScript framework A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build an ...
*
JavaScript library A JavaScript library is a library of pre-written JavaScript code that allows for easier development of JavaScript-based applications, especially for AJAX and other web-centric technologies. Libraries With the expanded demands for JavaScript, an ea ...


References


Further reading

* * * * * * * * *


External links


Dojo toolkit website
{{Authority control JavaScript libraries Ajax (programming) JavaScript-based HTML editors Software using the Academic Free License Software using the BSD license