i have some arrays and js objects put into a string using JSON.stringify
how can i decode that string again into arrays and objects ?
Thank you .
i have some arrays and js objects put into a string using JSON.stringify
how can i decode that string again into arrays and objects ?
Thank you .
JSON.parse
lets you do that.
You can see plenty of examples everywhere on the Intarwebs.
Even jQuery has a shim for this method (not supported in IE6, maybe 7): jQuery.parseJSON. That is, if you use jQuery.
You could use the eval method, or, much better, use JSON.parse. Please check this link for more info: http://www.json.org/js.html