# Dojo 0.4.2

There are a few ways to use Dojo 0.4.2:

- Use the XDomain Ajax Build directly from AOL's Content Delivery Network (CDN).
- Create a custom dojo.js build using the web build tool, and use the xdomain build on AOL's CDN to load all other modules and associated files.
- Download a custom build.
- Download Dojo source and make your own build.

## XDomain Ajax Build

To use 0.4.2 from AOL's CDN, just include this script tag in your page:
<script type="text/javascript" src="http://o.aolcdn.com/dojo/0.4.2/dojo.js"></script>

- Here is a sample file that demonstrates correct usage.
- Here is a template file to use with your editor (created for TextMate, but can be used with other editors).

There are some modules that require some special setup to use in the xdomain build:

### Widget automatic loading

- xdomain loading does not support automatic loading of Dojo or custom widgets. You must explicitly include widgets you want to use by using dojo.require() statements for widgets you want to use.

### dojo.debugDeep()

- Save src/debug/deep.html to your local server and set djConfig.dojoDebugDeepHtmlUrl to the location of that file.

### dojo.flash

- This module uses document.write(), so you must do a custom web build that includes the following modules to use it:

- dojo.event.*
- dojo.flash

### dojo.io.createIFrame()

- Save iframe_history.html to your local server and set djConfig.dojoIframeHistoryUrl to the location of that file.

### dojo.rpc.YahooService

- Save yahoo.smd to your local server and set djConfig.yahooServiceSmdUrl to the location of that file.

### dojo.storage

- This module uses document.write(), so you must do a custom web build that includes the following modules to use it:

- dojo.event.*
- dojo.storage

### dojo.undo.browser

- Save iframe_history.html to your local server and set djConfig.dojoIframeHistoryUrl to the location of that file.
- If you do a custom build using the web tool and want to use dojo.undo.browser, be sure to include it in dojo.js. Do not load it after dojo.js loads, otherwise it will not work.

### dojo.widget.GoogleMap

- Does not seem to work even if you include dojo.widget.GoogleMap in a custom build.

### dojo.widget.Editor2, dojo.widget.Editor, dojo.widget.RichText

- Save richtextframe.html to your local server and set djConfig.dojoRichTextFrameUrl to the location of that file.

More information on XDomain builds: Cross Domain Resource Loading. If you use the dojo.js URL above for the xdomain ajax build, you do not need to set any djConfig parameters for it to work. You also do not need a local dojo installation on your server.

## Web Build Tool

To build a custom dojo.js with the modules you use the most, use the Web Build Tool.
Save the dojo.js generated from the web build to your server, and for any modules that are not in that dojo.js, the AOL CDN mentioned above will be used to load them. The special setup for specific modules mentioned the XDomain Ajax Build section still apply, even if those modules are in your dojo.js file.

## Download Custom Build

Dojo offers some custom builds of Dojo that are not xdomain dojo builds. The code in these builds must reside on your server, and all of the files and directories in the build (except the demos and tests directories) must be on your server. You cannot just take the dojo.js file.

- Download a custom build.

## Download Source

You can download the full source code and create your own custom build. The source is offered in:

- zip format
- tar.gz format

See the Dojo Book for build instructions.