Rev 1318 | Blame | Last modification | View Log | RSS feed
The Dojo Toolkit----------------Dojo is a portable JavaScript toolkit for web application developers andJavaScript professionals. Dojo solves real-world problems by providing powerfulabstractions and solid, tested implementations.Getting Started---------------To use Dojo in your application, download one of the pre-built editions from theDojo website, http://dojotoolkit.org. Once you have downloaded the file you willneed to unzip the archive in your website root. At a minimum, you will need toextract:src/ (folder)dojo.jsiframe_history.htmlTo begin using dojo, include dojo in your pages by using:<script type="text/javascript" src="/path/to/dojo.js"></script>Depending on the edition that you have downloaded, this base dojo.js file may ormay not include the modules you wish to use in your application. The files whichhave been "baked in" to the dojo.js that is part of your distribution are listedin the file build.txt that is part of the top-level directory that is createdwhen you unpack the archive. To ensure modules you wish to use are available,use dojo.require() to request them. A very rich application might include:<script type="text/javascript" src="/path/to/dojo.js"></script><script type="text/javascript">dojo.require("dojo.event.*"); // sophisticated AOP event handlingdojo.require("dojo.io.*"); // for Ajax requestsdojo.require("dojo.storage.*"); // a persistent local data cachedojo.require("dojo.json"); // serialization to JSONdojo.require("dojo.dnd.*"); // drag-and-dropdojo.require("dojo.lfx.*"); // animations and eye candydojo.require("dojo.widget.Editor2");// stable, portable HTML WYSIWYG</script>Note that only those modules which are *not* already "baked in" to dojo.js bythe edition's build process are requested by dojo.require(). This helps makeyour application faster without forcing you to use a build tool while indevelopment. See "Building Dojo" and "Working From Source" for more details.Compatibility-------------In addition to it's suite of unit-tests for core system components, Dojo hasbeen tested on almost every modern browser, including:- IE 5.5+- Mozilla 1.5+, Firefox 1.0+- Safari 1.3.9+- Konqueror 3.4+- Opera 8.5+Note that some widgets and features may not perform exactly the same on everybrowser due to browser implementation differences.For those looking to use Dojo in non-browser environments, please see "WorkingFrom Source".Documentation and Getting Help------------------------------Articles outlining major Dojo systems are linked from:http://dojotoolkit.org/docs/Toolkit APIs are listed in outline form at:http://dojotoolkit.org/docs/apis/And documented in full at:http://manual.dojotoolkit.org/The project also maintains a JotSpot Wiki at:http://dojo.jot.com/A FAQ has been extracted from mailing list traffic:http://dojo.jot.com/FAQAnd the main Dojo user mailing list is archived and made searchable at:http://news.gmane.org/gmane.comp.web.dojo.user/You can sign up for this list, which is a great place to ask questions, at:http://dojotoolkit.org/mailman/listinfo/dojo-interestThe Dojo developers also tend to hang out in IRC and help people with Dojoproblems. You're most likely to find them at:irc.freenode.net #dojoNote that 3PM Wed PST in #dojo-meeting is reserved for a weekly meeting betweenproject developers, although anyone is welcome to participate.Working From Source-------------------The core of Dojo is a powerful package system that allows developers to optimizeDojo for deployment while using *exactly the same* application code indevelopment. Therefore, working from source is almost exactly like working froma pre-built edition. Pre-built editions are significantly faster to load thanworking from source, but are not as flexible when in development.There are multiple ways to get the source. Nightly snapshots of the Dojo sourcerepository are available at:http://archive.dojotoolkit.org/nightly.tgzAnonymous Subversion access is also available:%> svn co http://svn.dojotoolkit.org/dojo/trunk/ dojoEach of these sources will include some extra directories not included in thepre-packaged editions, including command-line tests and build tools forconstructing your own packages.Running the command-line unit test suite requires Ant 1.6. If it is installedand in your path, you can run the tests using:%> cd buildscripts%> ant testThe command-line test harness makes use of Rhino, a JavaScript interpreterwritten in Java. Once you have a copy of Dojo's source tree, you have a copy ofRhino. From the root directory, you can use Rhino interactively to load Dojo:%> java -jar buildscripts/lib/js.jarRhino 1.5 release 3 2002 01 27js> load("dojo.js");js> print(dojo);[object Object]js> quit();This environment is wonderful for testing raw JavaScript functionality in, oreven for scripting your system. Since Rhino has full access to anything inJava's classpath, the sky is the limit!Building Dojo-------------Dojo requires Ant 1.6.x in order to build correctly. While using Dojo fromsource does *NOT* require that you make a build, speeding up your application byconstructing a custom profile build does.Once you have Ant and a source snapshot of Dojo, you can make your own profilebuild ("edition") which includes only those modules your application uses bycustomizing one of the files in:[dojo]/buildscripts/profiles/These files are named *.profile.js and each one contains a list of modules toinclude in a build. If we created a new profile called "test.profile.js", wecould then make a profile build using it by doing:%> cd buildscripts%> ant -Dprofile=test -Ddocless=true release intern-stringsIf the build is successful, your newly minted and compressed profile build willbe placed in [dojo]/release/dojo/-------------------------------------------------------------------------------Copyright (c) 2004-2006, The Dojo Foundation, All Rights Reservedvim:ts=4:et:tw=80:shiftwidth=4: