jQuery.toJSON(object, compact, indent
, depth
)
Parameters:
Compact
true
false
add spaces between elements in the json string? This setting is ignored when indent=true
Indent
true
false
this setting allows for indented json formatting.
Depth
0
The depth paramater is used internally to recursively indent the json string, and to check whether the maximum recursion depth is reached.
Choose the javascript to convert to json:
document.getElementById('convert_btn')
document
[1,2,3,'hi',{x:1,y:2,z:3},99]
document.getElementsByTagName('INPUT')
"I am just a text string"
1
convert to json
The resulting json: