Blogger :
Ajaxian Blog
All posts :
All posts by Ajaxian Blog
Category :
XML
Blogged date : 2008 Nov 11
Tom Trenka has a nice posting on Dojo and Firebug Tricks for Development where he shares two of his own:
Trick #1: using window.location.search to enable Firebug Lite on the fly
With the Dojo Toolkit, I find this trick indispensable. The basic concept is to use the original version of the djConfig variable—the object-based one—using a boolean to enable or disable debugging.
In a single line of code, here’s the trick:
JAVASCRIPT:
-
-
var djConfig = { isDebug: (window.location.search.indexOf("debug")>-1) };
-
Trick #2: setting up a simple HTML file that just enables the console
Once you drop in the simple HTML file below, you can bookmark it, load up your Dojo world, and then start to use Firebugs "Run" command to access Dojo-ness.
Start with this:
HTML:
-
-
-
-
-
-
src="dojo/dojo.js" djConfig="isDebug: true">
-
-
-
-
-
This is a quick and dirty file you can use
-
to do console-based development.
-
-
-
-
And then "Run" something like this:
JAVASCRIPT:
-
-
dojo.require("dojox.xml.DomParser");
-
-
var xml=''
-
+ 'My first node'
-
+ 'My second node'
-
+ '';
-
var doc=dojox.xml.DomParser.parse(xml);
-
console.log(doc);
-

What tips and tricks do you have?