如下写法如果参数带空格会报错Uncaught SyntaxError: Invalid or unexpected token
$(row).children('td').eq(1).html('<a href="javascript:void(0)" onclick=editor_idc_special("' + data.b+ '")>' + data.a+ '</a>')
改为如下写法将 "editor_idc_special(args)"
用引号圈起来
$(row).children('td').eq(1).html('<a href="javascript:void(0)" onclick="editor_idc_special(\'' + data.b+ '\')">' + data.a+ '</a>')
网友评论