string data,

Returns a passed string as JSON-object.

Note: In case of a string parsing error, onParseJSONFailure event will be called.

Function parameters

Parameter Description
string data String
context Optional. In case of an error (and the call of onParseJSONFailure), this context will be passed via second parameter to the handler.

Examples of use

BX.parseJSON('{test: 123}');
Object {test: 123} 
© «Bitrix24», 2001-2023