[jQuery] $.fn.dbg() plugin

[jQuery] $.fn.dbg() plugin

Here's a little plugin that might be useful. It could be simpler
to use, at times, than preparing Venkman for a debugging run. It
helped me determine what the x/y coords were for an event by using
it like...
$(this).dbg(event) ... or obviously inline within a jQuery chain.
$.fn.dbg = function(obj) {
var buf = '';
var o = obj || this;
if (o) {
for (var i in o) {
if ((o[i] instanceof Function)
|| (o[i] == null)
|| (i.toUpperCase() == i)) continue;
buf += i + '=' + o[i] + ', ';
}
} else buf = 'Null Object';
alert(buf);
return o;
}
--markc
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/