pureweb.util. jsonConverter

The jsonConverter namespace provides JSON utility methods.

Method Summary

objToJsonString
Converts the specified JavaScript object into a JSON string and returns that string.
parseDOM
Takes a DOM element or document and returns an equivalent JSON object.
writeXML
Returns an XML string from a JavaScript object.

Method Detail

<static> objToJsonString(obj) → {string}

Converts the specified JavaScript object into a JSON string and returns that string.
Parameters:
Name Type Description
obj Object The object to be serialized.
Throws:
pureweb.NullArgumentException

<static> parseDOM(root) → {Object|Array.<string>|string|undefined}

Takes a DOM element or document and returns an equivalent JSON object.
Parameters:
Name Type Description
root Element The element or document to be converted.
Throws:
pureweb.NullArgumentException

<static> writeXML(tree) → {string}

Returns an XML string from a JavaScript object.
Parameters:
Name Type Description
tree Object The object to be converted.
Throws:
pureweb.NullArgumentException