我在JS 中拼接html
var html = '<a href="#" onclick="onedit("+ row.id + ")">编辑</a>';
在项目中点击是后台报错 : missing ) after argument list 或者 Uncaught SyntaxError: Unexpected token }, 查了一下是拼接的串里面有特殊字符需要处理.
正确的写法是:var html = "<a href='#' onclick="onedit('"+row.id+"')">编辑</a>";