Thursday, August 22, 2013

How do I convert a JSON string to a JavaScript object in jQuery?

How do I convert a JSON string to a JavaScript object in jQuery?

JSON.parse(string) - parses a JSON string, reconstructing the original JavaScript object.
JSON.stringify(object) - accepts a JavaScript object and returns its JSON equivalent.

No comments: