Your data
is a string of '[{}]'
at that point in time, you can eval
it like so:
function(data) {
data = eval( '(' + data + ')' )
}
However this method is far from secure, this will be a bit more work but the best practice is to parse it with Crockford's JSON parser: https://github.com/douglascrockford/JSON-js
Another method would be $.getJSON
and you'll need to set the dataType
to json for a pure jQuery reliant method.