JavaScript jQuery.debug – A Simple Debugger

The jQuery.debug plugin is a simple but useful utility to dump variables visibly, directly within the HTML document. This allows you to track any variable any time, track values changed by events etc.

If the plugin is linked, a function jQuery.debug() can be used as the constructor of a single debugger. You may use simultaneously as many debuggers as you need. To use the debugger, you have to do two things:

  1. instatiate new debugger
  2. call its dump() method anywhere in your code
  3. more features may come in the future
// Example:

var debug = new jQuery.debug();
// ...
debug.dump(myObject);
// ...

See plugin source code or the example and its source code for more details.

Download: version 1.0 (01/16/2009)

Published on January 16, 2009 by Petr Staníček • Category: JavaScript

Tags: , ,

6 Comments to “jQuery.debug – A Simple Debugger”

[1] by pk on February 3, 2009, 4:57pm

The example here cannot work, since the new statement is missing.

[2] by Petr Staníček on February 3, 2009, 5:15pm

I don't get it. „new“ is the JS keyword, and the example seems to work. In which browser it doesn't work?

[3] by pk on February 3, 2009, 5:27pm

I mean the example code in this article, 1. line. The linked example works well.

[4] by Petr Staníček on February 3, 2009, 10:32pm

Oh, yes! Thanks, fixing.

[5] by pk on February 16, 2009, 10:09pm

  1. the example in jquery.debug.js contains syntax error: posTo{...posTo:{....
  2. I don't really understand the principle, but many jq plugins use variable (variable?) jQuery instead of $. It has something with compatibility issues (jQ vs other frameworks). For example, now I tried to load jq.debug inside WordPress admin → firebug showed errors → mass replace $=>jQuery → works.

[6] by Petr Staníček on February 16, 2009, 11:03pm

[5] OK, you're right. I'm sorry, I'm so used to the ‚$‘-syntax so I didn't get this may be a problem. I fixed everything to the ‚jQuery‘-syntax. Thanks for the report.

Something serious to tell?

To comment, you have to login.