I have an array of arrays which I have planted in the DOM, so that I can reuse it at a later stage to transfer to the server:
[["1","aaaaaa","1"],["2","bbbbbbb","2"],["3","ccccccc","3"]]
If I would like to convert it back into a Javascript array, how would I go about doing this?
var obj = $.parseJSON('[["1","aaaaaa","1"],["2","bbbbbbb","2"],["3","ccccccc","3"]]')
Assuming jquery is ok to use because of tag.
If the browzer has the JSON
object then
JSON.parse(string);
or if you have jQuery
$.parseJSON(string);
var array = JSON.parse(my_JSON)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With