Sereen
Sereen

Reputation: 39

Convert String to JSON using Javascript

kindly i want to convert this string to Json using javascript

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

i firstly use

   Result=Result['result']

and i have this

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

please your help to continue

Upvotes: 0

Views: 92

Answers (1)

Vladu Ionut
Vladu Ionut

Reputation: 8183

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'])

Upvotes: 2

Related Questions