Things:
Return List type data from the java background for interface display. But I want to get it and operate it in js. Use the EL expression directly, and js will recognize it as a string. Not what I want. . I searched online for everyone's solutions... The best one is of course to convert the List collection into json format and transfer it to the interface. In this way, the operation in js is simple and the page will not be affected.
Solution:
Convert List into json and pass it to the interface. In js, use var arr = eval (‘${list}’); to convert the list into a js array.
My code:
var keyList = eval('${keysList}');
var values = $("#paramsValues").val();
var noSet = [];
for(var i=0;iif(values.indexOf(keyList[i])==-1){
noSet.push(keyList[i]);
}
}