I have a JSON string that I would like to convert to a javascript array. How can I do this?
I was under the impression thot JQuery could do this
json2.js is the usual choice for this. It has decent error checking and will use native browser decoding if available.
in general you can do JSON.parse(jsonString). Most browsers support this.
with jquery, if you tell $.ajax() that the response type is json, it will do this for you. See the 'dataType' option here http://api.jquery.com/jQuery.ajax/
{ "x": "y" }, how exactly do you want to "convert" that to an array? You can parse it, and then store the object in an array if you want to, I guess, but without more explanation it's hard to know exactly what you're trying to achieve.