I’m using JSON.js provided in JSON.org
<%
JSONReturn = GetDistance(Sample) // return a string in JSON format (Arcgis server Solve route function)
JSONObject = JSON.parse(JSONReturn,"Total_Length")
%>
I’m trying to get the “total_length” data in the JSON object. May I know how can I retrieve it?
GetDistance Return this
{
"routes" : {"spatialReference" : {
"wkid" : 4326
},
"features" : [
{
"attributes" : {
"ObjectID" : 1,
"Name" : "Location 1 - Location 2",
"FirstStopID" : 1,
"LastStopID" : 2,
"StopCount" : 2,
"Total_Length" : 0.498263273388147,
"Shape_Length" : 0
},
"geometry" : null
}
]
},
"messages" : [
]
}
Try this.