Wikia

Unofficial Konfabulator Wiki

Watchlist FAQ

Dump Object Contents to Debug Window

A useful feature of Konfabulator's debug window is the ability to write the contents of an object to the Window. Typing the following command in the debug window enumerates every property and method of the specified object.

/dump obj

However, sometimes it is nice to be able to achieve the same effect through JavaScript; if for example you are debugging a Widget and you always want to see the contents of an object at a particular point, this function provides (nearly) the same functionality as the /dump command. The only difference is that where the /dump command writes the actual name of the object to the debug window, this function writes "object". One useful thing about it is that you can specify an optional second argument, includeFunctions (false by default). If you don't want functions to be shown (which you probably won't), just leave this argument out.


function dump (obj, includeFunctions) {
    print('Object');
    for (key in obj) {
        var thisObj = obj[key];
        if (typeof(thisObj)') != 'function' || includeFunctions == true) {
            print('    object[' + a + ']: ' + thisObj));
        }
    }
}

Pages on Unofficial Konfabulator Wiki

Add a Page
114pages on
this wiki
Advertisement | Your ad here

Latest Photos

Add a Photo
126photos on this wiki
See more >

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki