.. _api_javascript_others: ======================== JavaScript API Reference ======================== .. _api_javascript_jsonloads: --------- jsonloads --------- .. code:: javascript jsonloads(obj) Loads a new object loaded from the JSON passed in ``obj``. +-----------------------------------------------------------------------------------------------------------------------------+ | Parameters | +==================+================================+=========================================================================+ | Name | Type | Description | +------------------+--------------------------------+-------------------------------------------------------------------------+ | obj | JSON string | A string containing JSON data. | +------------------+--------------------------------+-------------------------------------------------------------------------+ | +-----------------------------------------------------------------------------------------------------+ | Returns | +================================+====================================================================+ | Type | Description | +--------------------------------+--------------------------------------------------------------------+ | obj | The Object that the JSON decoded to. | +--------------------------------+--------------------------------------------------------------------+ .. _api_javascript_jsondumps: --------- jsondumps --------- .. code:: javascript jsondumps(obj) Returns the JSON string for an object. +-----------------------------------------------------------------------------------------------------------------------------+ | Parameters | +==================+================================+=========================================================================+ | Name | Type | Description | +------------------+--------------------------------+-------------------------------------------------------------------------+ | obj | {} | An object to be converted into a JSON string. | +------------------+--------------------------------+-------------------------------------------------------------------------+ | +-----------------------------------------------------------------------------------------------------+ | Returns | +================================+====================================================================+ | Type | Description | +--------------------------------+--------------------------------------------------------------------+ | JSON string | The JSON string of ``obj``. | +--------------------------------+--------------------------------------------------------------------+ .. _api_javascript_dimebloads: ---------- dimebloads ---------- .. code:: javascript dimebloads(bytes) +-----------------------------------------------------------------------------------------------------------------------------+ | Parameters | +==================+================================+=========================================================================+ | Name | Type | Description | +------------------+--------------------------------+-------------------------------------------------------------------------+ | bytes | bytes[] | An array of bytes. | +------------------+--------------------------------+-------------------------------------------------------------------------+ | +-----------------------------------------------------------------------------------------------------+ | Returns | +================================+====================================================================+ | Type | Description | +--------------------------------+--------------------------------------------------------------------+ | Object | The object that the bytes decoded to. | +--------------------------------+--------------------------------------------------------------------+ .. _api_javascript_dimebdumps: ---------- dimebdumps ---------- .. code:: javascript dimebdumps(obj) Returns the bytes of ``obj``. +-----------------------------------------------------------------------------------------------------------------------------+ | Parameters | +==================+================================+=========================================================================+ | Name | Type | Description | +------------------+--------------------------------+-------------------------------------------------------------------------+ | obj | Object | An object. | +------------------+--------------------------------+-------------------------------------------------------------------------+ | +-----------------------------------------------------------------------------------------------------+ | Returns | +================================+====================================================================+ | Type | Description | +--------------------------------+--------------------------------------------------------------------+ | bytes[] | An array of the bytes making up ``obj``. | +--------------------------------+--------------------------------------------------------------------+