I have encountered a bizarre case when attempting to parse some JSON data sent from a server.
The data is essentially, a set of rows of data - i.e. a list of lists, and looks something like this:
[[1,2,3],[4,5,6],[7,8,9]]
In FF (using Firebug), the received JSON data is valid, and renders correctly.
When I attempt to parse the JSON data using either of this statements, it fails:
JSON.parse()
code breaks on errorjQuery.parseJSON()
parses without complaining, yet the result of the parse is a null object
The only way I have managed to successfully parse the JSON response, is to use the dreaded eval()
statements, which is a BIG security issue.
Anyone knows what may be going on?
>>> JSON.parse("[[1,2,3],[4,5,6],[7,8,9]]"); [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
. I suspect that you have over-reduced your reduced test case.