Hi,
i got a ajax json response in my javascript page as below
{"result":"[VSummary [userName=kk, plan=Professional, sDate=null, plate=EVA 5653, groupName=null, vehicleType=null, defaultDriver=null, solrQuery=null, driver=null, firstActiveTime=0, lastActiveTime=0, distance=0.0, maxSpeed=0.0, exceptions=0, trips=0, fuelConsumed=0.0, movHrs=0.0, stopHrs=0.0, idlingHrs=62000.0, engineHrsOn=0.0, engineHrsOff=0.0, workingHrs=0.0]]"}
Here
VSummary is a list of object retured from my java application. How can i convert VSummary to list in JAVASCRIPT
JSON.parse is not working here
var a=JSON.parse(response.result); // here
response is the json response
SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data
What I have tried:
var response = JSON.parse('{"result":"[VSummary [userName=kk, plan=Professional, sDate=null, plate=EVA 5653, groupName=null, vehicleType=null, defaultDriver=null, solrQuery=null, driver=null, firstActiveTime=0, lastActiveTime=0, distance=0.0, maxSpeed=0.0, exceptions=0, trips=0, fuelConsumed=0.0, movHrs=0.0, stopHrs=0.0, idlingHrs=62000.0, engineHrsOn=0.0, engineHrsOff=0.0, workingHrs=0.0]]"}');
var a=JSON.parse(response.result);
SyntaxError: JSON.parsed character at line 1 column 2 of the JSON data
var a=response.result["VSummary"]
undefined