js中出现missing ) after argument list
时间:2017-01-23 15:15:27
收藏:0
阅读:4071
我在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>";
原文:http://www.cnblogs.com/aivnfjgj/p/6344019.html
评论(0)