The DP_Debug script extends JavaScript with (we think) useful debugging methods.
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitattributes
.gitignore
DP_Debug.js
README.md

README.md

DP_Debug

The DP_Debug utility script extends JavaScript with (we think) useful debugging methods. The following methods are made available:

  • dump(): Converts JavaScript objects (their properties, values and relationships) to an HTML representation and displays this in the console for review. It supports objects with circular/recursive references. It's similar to the insanely useful CFDUMP tag in ColdFusion.
  • dumpCookies(): A convenience method which dumps all available browser cookies to the console.
  • dumpQueryString(): A convenience method which dumps all available query-string names and values to the console.
  • logger(): A method for logging messages to the console using either custom or predefined types. logInfo(), logWarning() and logError() are all shortcut methods for logging specific types of messages easily.
  • timer(): A method for timing blocks of code.
  • getType(): Provides more advanced Object type-recognition than the native "typeof" operator.

The extension is self-contained and present an extremely small footprint. Only a single global object, "DP_Debug", is created.

This component requires a JavaScript (ECMAScript) 1.3 (or better) development environment and has been tested successfully on Internet Explorer 6+, Firefox 1+ and Opera 9+.

Copyright (c) 1996-2013, The Depressed Press (depressedpress.com)
All rights reserved.
Covered under the BSD Open Source License (included in the code). Full legal information here: http://depressedpress.com/about/source-code-policy/