Possible Duplicate:
How to parse JSON in JavaScript
I get a string like this
[["1","Pagamento de Placa","N","N"], ["2,""Contrato","N","N"], ["3","Ajuste de preço","N","N"],["4", "Abertura de cliente","N","N"], ["9","Outros","N","S"]]
I try
var arr = new Array([["1","Pagamento de Placa","N","N"], ["2,""Contrato","N","N"], ["3","Ajuste de preço","N","N"],["4", "Abertura de cliente","N","N"], ["9","Outros","N","S"]]);
but not work
I want to turn into a real array, any idea how to do?
Thanks
Use JSON.parse:
(There’s a duplicate
"in the original string – I removed it.)If you need to support older browsers use a library like json2.js or jQuery.parseJSON.