API/libsapojs/SAPO/Utility/Dumper

[Elements] are optional

Class SAPO.Utility.Dumper


class SAPO.Utility.Dumper
Lib to dump (print, return, alert) a variable structure Can me called: SAPO.Utility.Dumper.printDump SAPO.Utility.Dumper.alertDump SAPO.Utility.Dumper.returnDump SAPO.Utility.Dumper.windowDump HowTo: var obj = { key1: 'value1', key2: 'value2', keyArray: ['arrayValue1', 'arrayValue2', 'arrayValue3'] } SAPO.Utility.Dumper.printDump(obj); SAPO.Utility.Dumper.printDump(obj, 'target_element_id'); SAPO.Utility.Dumper.alertDump(obj); SAPO.Utility.Dumper.windowDump(obj); alert(SAPO.Utility.Dumper.returnDump(obj));
Defined in Utility/Dumper/0.1/lib.js

Variable Summary
private String _tab

Function Summary
private String _formatParam (Any param)
private String _getTabs (Number numberOfTabs)
private String _outputFormat (Any param, Number dim)
formats the param to display
alertDump (Object|String|Boolean param)
alert variable structure
printDump (Object|String|Boolean param, [String|Object target])
print variable structure Can be passed an output target
String returnDump (Object|String|Boolean param)
return variable structure
windowDump (Object|String|Boolean param)
print to new window the variable structure

Variable Details

variable private String _tab


Function Details

function _formatParam

private String _formatParam(Any param)
Parameters:
param
Returns:
the argument passed formated

function _getTabs

private String _getTabs(Number numberOfTabs)
Parameters:
numberOfTabs
Returns:
the tabs concatenated

function _outputFormat

private String _outputFormat(Any param, Number dim)
formats the param to display
Parameters:
param
dim
Returns:
the output format

function alertDump

alertDump(Object|String|Boolean param)
alert variable structure
Parameters:
param

function printDump

printDump(Object|String|Boolean param, [String|Object target])
print variable structure Can be passed an output target
Parameters:
param
[target] (can be an element ID or an element)

function returnDump

String returnDump(Object|String|Boolean param)
return variable structure
Parameters:
param
Returns:
variable structure

function windowDump

windowDump(Object|String|Boolean param)
print to new window the variable structure
Parameters:
param