J
Jim Davis
I've a JavaScript debug library which I've finally documented and posted. I
find it very useful (especailly to check out returns from AJAX-type
services) and I hope you might as well.
A zip of the library, documentation and examples are here (at this very long
URL):
http://www.depressedpress.com/depre...ment/JavaScript/Extensions/DP_DeBug/Index.cfm
The library adds two methods to the Object prototype: dpDump() which
presents an HTML display of any object and dpGetType() which provides a more
refined type mechanism than the typeof operator.
dpDump is the more useful of the two by far. It provides:
+) HTML representation of any complex object including nesting and data
type.
+) It supports circular/recursive references in objects (which I think is
damn spiffy).
+) It provides a dedicated debug window which can log multiple
dpDump() calls over time.
+) It returns a reference to the object enabling insertion of dpDump calls
into method calls. For example this is legal:
MyArray.dpDump().reverse().dpDump() and will result in a "before and after"
view of the array.
It has a very small footprint - only those two methods are added to the
Object Prototype - no extra properties, sub functions or anything. All of
the code (style sheets, html, etc) is embedded in the library - there are no
external calls (although there is a link to my site on the debug window).
I've tested the library in IE 6.x and FireFox 1.x - but I'm sure there are
still some bugs floating around.
I'd love to hear any comment or suggestions you may have about the Library
itself, the documentation or the examples. I'd especially love reports of
any bugs you might come across.
Thanks,
Jim Davis
find it very useful (especailly to check out returns from AJAX-type
services) and I hope you might as well.
A zip of the library, documentation and examples are here (at this very long
URL):
http://www.depressedpress.com/depre...ment/JavaScript/Extensions/DP_DeBug/Index.cfm
The library adds two methods to the Object prototype: dpDump() which
presents an HTML display of any object and dpGetType() which provides a more
refined type mechanism than the typeof operator.
dpDump is the more useful of the two by far. It provides:
+) HTML representation of any complex object including nesting and data
type.
+) It supports circular/recursive references in objects (which I think is
damn spiffy).
+) It provides a dedicated debug window which can log multiple
dpDump() calls over time.
+) It returns a reference to the object enabling insertion of dpDump calls
into method calls. For example this is legal:
MyArray.dpDump().reverse().dpDump() and will result in a "before and after"
view of the array.
It has a very small footprint - only those two methods are added to the
Object Prototype - no extra properties, sub functions or anything. All of
the code (style sheets, html, etc) is embedded in the library - there are no
external calls (although there is a link to my site on the debug window).
I've tested the library in IE 6.x and FireFox 1.x - but I'm sure there are
still some bugs floating around.
I'd love to hear any comment or suggestions you may have about the Library
itself, the documentation or the examples. I'd especially love reports of
any bugs you might come across.
Thanks,
Jim Davis