0

I have a encoded JSON string returning the following sting which I am displaying on my webpage from a database call.

{"Value 1":"1234","Value 2":"123456"}

How do I decode this string and also format the data to be displayed in a table?

I am at a lost as how to do this. Thanks

4
  • Google the title of the question, and you'll find the answer Commented Apr 10, 2015 at 10:55
  • 2
    possible duplicate of Parse JSON in JavaScript? Commented Apr 10, 2015 at 10:55
  • 1
    What you appear to have in your question is already an object, which does not require any decoding. Commented Apr 10, 2015 at 10:57
  • There are lots of tutorials on how to create html from json. This post will also be very helpful stackoverflow.com/questions/11922383/… Commented Apr 10, 2015 at 12:04

1 Answer 1

2

Here is how to turn a string containing a JSON into an object:

JSON.parse('{"Value 1":"1234","Value 2":"123456"}');
Sign up to request clarification or add additional context in comments.

1 Comment

Can you parse the JSON string inside a AJAX request?

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.