Your JSON is not valid.
Once you create a valid JSON string, parsing it is very simple.
Use the following steps:
- remove the commas after the last property of each object
- remove the newlines
- wrap the JSON text in single quotes
- call jQuery.parseJSON() on the text
Here's a working fiddle.
It does something like this:
var jsonText = '[ { "cid": "3", "pid": "0", "nid"...} ]';
var jo = $.parseJSON(jsonText);