dojo.toJson
<script src="../../js/dojo.js"></script>
defined in dojo/_base/json.js
Returns a JSON serialization of an object. Note that this doesn't check for infinite recursion, so don't do that!
parameter | type | description |
---|---|---|
it | Object | an object to be serialized. Objects may define their own serialization via a special "__json__" or "json" function property. If a specialized serializer has been defined, it will be used as a fallback. |
prettyPrint | Boolean | Optional. if true, we indent objects and arrays to make the output prettier. The variable dojo.toJsonIndentStr is used as the indent string -- to use something other than the default (tab), change that variable before calling dojo.toJson(). |
_indentStr | String | Optional. private variable for recursive calls when pretty printing, do not use. |