JSON:
{
"time":"1520480018644",
"start":"0",
"search":{
"search":"",
"smart":"true",
"regex":"false",
"caseInsensitive":"true"
},
"columns":[
{
"visible":"false",
"search":{
"search":"",
"smart":"true",
"regex":"false",
"caseInsensitive":"true"
},
"width":"200px"
},
{
"visible":"true",
"search":{
"search":"",
"smart":"true",
"regex":"false",
"caseInsensitive":"true"
},
"width":"200px"
}
]
}
Program:
$.each(json_data, function(index, val) {
$.each(val, function(index1, val1) {
if(val1 == 'true'){
json_data[index][index1] = True;
}
if(val1 == 'false'){
json_data[index][index1] = False;
}
});
});
As you can see all boolean value in the string. How can I change the string to boolean respectively? I don't have any alternative way I just need to change the string to boolean respectively. Sorry for my weak English.