Modifying the jQuery dump plugin to not open in a new window


I have been using the jQuery version of the javascript dump for a while now and it is invaluable especially when debugging JSON objects.  The one down side to the plugin is it tries to display the dump contents in a new window, but I prefer to just get the html contents and stuff it into a div.

As it turns out it was pretty easy to modify the plugin to work how I wanted. To make the collapse/expand feature work I had to make the functions global but it is cool as long as you don’t have any functions on the page with the same name.

Here is an example page:

The dump results:

If you would like check out the dump plugin, here is my modified jqDump.js file.

Advertisements

About Robert Zehnder

Web application developer specializing in ColdFusion/Railo and Open Source development.

Posted on July 17, 2012, in General, jQuery and tagged , . Bookmark the permalink. 2 Comments.

  1. “… I had to make the functions global but it is cool as long as you don’t have any functions on the page with the same name.”

    Does this mean that you can only call it once and have it work properly?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: