(1)向后台发送请求的url中参数有中文,可能会出错,解决方法:使用encodeURIComponent()函数转换该参数。
例如:var url="${base}/platform/exportbysearch?labelid="+labelid+"&query="+encodeURIComponent(query);
(2)有时判断数组中是否有某元素时,要注意“1”和1是不同的元素。
字符串数组转为数字数组:['1','2','3'].map(Number); //[1,2,3]
数字数组转为字符串数组:[1,2,3].map(String); //['1','2','3']
(3)onclick加引号的问题
给元素绑定事件,onclick执行的函数要加引号
return '<input type="checkbox" οnclick="selectItem()">'
当绑定的函数需要参数时,有时参数需要再加一个引号,例如
return '<input type="checkbox" οnclick="selectItem(\''+row.id+'\')">'
(n)WebGL学习
https://www.cnblogs.com/bsman/p/6128447.html