Home > General, jQuery > Modifying the jQuery dump plugin to not open in a new window

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.

About these ads
Categories: General, jQuery Tags: ,
  1. James Moberg
    July 18, 2012 at 11:32 am | #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?

    • July 18, 2012 at 11:36 am | #2

      Correct. The functions created with the plugin are tRow, tTable, tSource and tTarget. As long as you do not overwrite these global functions you are good ;)

  1. No trackbacks yet.

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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 734 other followers

%d bloggers like this: