ANN: Update to JavaScript Debug Library

J

Jim Davis

I've made a significant update to my debugging library available here:

<http://www.depressedpress.com/depre...ment/JavaScript/Extensions/DP_Debug/Index.cfm>

This version's new features:

+) Several people requested the ability to dump system objects ("document",
"window", "style", etc). This version lets you do that via two
improvements:

-) You can now control the depth of the recursive dump. System objects
like "document" are just too damn big for something like this: the
"document" object can easily represent several tens of thousands properties.
I've never been able to get my system to successfully parse past 6 levels of
recursion and my laptop can only deal with 3 before crashing the browser...
and so the introduction of the MaxRecurseLevel argument to dpDump().

-) There are some system objects that are just plain weird. All will
return a typeof "object" yet some will throw an error if you attempt to
enumerate their properties. In other cases you might get an error just
doing "typeof" and still in others just looking sideways at the object will
throw an error (just doing "Object[Prop];" will throw an error in some
cases). The new version does its level best to prevent these issues from
killing the entire dump.

The use of this feature is just plain fascinating to me... I spent several
hours just dumping things like "document.body.style", "document.images" and
so forth in both IE and FireFox to see all the differences (and boy are
there are lot of differences). ;^)

But I really think that being able to dump style and other DOM information
like this can be an invaluable asset.

+) Any element label can be clicked to hide the data for that element (the
element label will be italicized if its related data is hidden). Click the
element again to redisplay the data. This is very useful to manage large
dumps (you can just hide large, but currently unimportant objects).

+) References to previously displayed objects now feature a link to the
displayed object. This feature only work in IE however (frustratingly
FireFox doesn't allow for local links in generated pop-up content). I'm not
fond of being browser-specific but I can't see any way around this one.
This can help you get around in those large, deep dumps. The links are
specific to each instance of dpDump() even if multiple instances are
displayed in the same debugging window.

In addition there were several general "hardening" bug fixes (for example
dpGetType() no longer results in an error on system elements that would
error using typeof). Some of the more ugly code was tightened up and the
flow of display was streamlined (which allowed me to discover and eliminate
several HTML errors in the dump output).

Anyways, there it is - enjoy. As always I appreciate all constructive
criticism and suggestions.

Jim Davis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top