I've been playing with Dojo, specifically the rich text editor, and came across a Gotcha in setting up the whole thing, which isn't documented too clearly. Specifically, Dojo needs its own window.onload - if you have your own window.onload (as you probably do if you need any initialisation), it will conflict with Dojo!!!
The solution is described here (though it seems Dojo changed a property name a few months ago, from baseRelativePath to baseScriptURI). This is working for me - in my HTML:
In myapp.js:
- dojo.require("dojo.event.*");
- dojo.event.connect(window, "onload", myappInit);
- function myappInit() {
- alert("Okay, here we are in the old window.onload and it's still running
"); - }
It might be a good idea for the Dojo crew included some explanation of this in the standard heres-how-to-setup-dojo.js-intro docs. Maybe someone with in-depth knowledge of Dojo could infer that window.onload must be used by Dojo, but the average programmer taking Dojo a spin won't.
Links:
- I'm not the only person to be caught out by this
- Setting up Rich Text Editor under Rails Covers some issues with relative paths
Dojo. Awesome framework. Bring on the doco.

You saved my life!
Thanks, Joe