dojo : Debugging


1. Use Firebug or Firebug Lite

Firebug, an open source debugging extension for Firefox, is essential for JavaScript, HTML and CSS debugging. You can download it from the Firebug web site.

2. Logging

In Dojo logging, you can associate messages with severity, just like in log4j. The following code illustrates the five severity levels:

console.log(“Nothing happening”);
console.debug(“Checking to make sure nothing happened”);“Something might happen.”);
console.warn(“Something happened, but it’s no big deal.”);
console.error(“Cough cough!”);


3. The “debugger” Statement

Alternatively you can set a “poor person’s breakpoint” in the code. Just insert the debugger; statement, which is a legal JavaScript reserved word.

debugger; = dojo.newWidth;

This statement stops the code and brings you to a Firebug command prompt.

One Response

  1. I think the admin of this site is really working hard in support of his
    web site, since here every stuff is quality based

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: