Sereen Sereen - 1 year ago 108
JSON Question

Convert String to JSON using Javascript

kindly i want to convert this string to Json using javascript

Result = {"result":"{\"Response\":\"Success\"}"}

i firstly use


and i have this

Result= '{"Response":"Success"}'

please your help to continue

Answer Source

You can use JSON.parse

The JSON.parse() method parses a string as JSON, optionally transforming the value produced by parsing.

 Result =    {"result":"{\"Response\":\"Success\"}"};
 Result = JSON.parse(Result['result'])
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download