I've the below combination of server-side and client-side json processing code. I'm able to load json data from remote url and from local .js file.
But, somehow I'm unable to figure out how to load data from the serverjson object in the below code snippet.
var json ;
<#list jsons as json>
serverjson = ${json};
console.log(serverjson);
$.getJSON(---have to load data from json object----).done(function (jsonData) {
var time = 0; var curc = 0; var prec = 0;
$.each(jsonData.current.timeSeries, function(i,item){
//console.log(jsonData.current.timeSeries[i].beginTimeSeconds+" : "+jsonData.current.timeSeries[i].endTimeSeconds+" : "+jsonData.current.timeSeries[i].inspectedCount);
time = jsonData.current.timeSeries[i].beginTimeSeconds;
curc = jsonData.current.timeSeries[i].inspectedCount;
//curdata.addRows([curc]);
curdata.push(curc)
//data.addRows([[jsonData.current.timeSeries[i].beginTimeSeconds,jsonData.current.timeSeries[i].endTimeSeconds,jsonData.current.timeSeries[i].inspectedCount]]);
});
</#list>
So, to conclude, I'm not passing remote url or .js file in the $.getJSON() function, I need to pass serverjson object.
Please help me how to solve this.
Thanks in advance.