0

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

3
  • 3
    you can use JSON.parse Commented Sep 27, 2016 at 6:30
  • For your information, JSON is already a String hence "Convert String to JSON using Javascript" is wrong title.. '{"Response":"Success"}' is JSON hence String, to convert it as Object, Use JSON.parse(YOUR_JSON) Commented Sep 27, 2016 at 6:31
  • Possible duplicate of Safely turning a JSON string into an object Commented Sep 27, 2016 at 7:16

1 Answer 1

2

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'])
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.