I would like to convert this string
{\"id\":1,\"name\":\"Test1\"},{\"id\":2,\"name\":\"Test2\"}
to array of 2 JSON objects. How should I do
Using jQuery:
var str = '{"id":1,"name":"Test1"},{"id":2,"name":"Test2"}'; var jsonObj = $.parseJSON('[' + str + ']');
jsonObj is your JSON object.
jsonObj