在参数列表后获取“ SyntaxError:缺少)

时间:2018-06-24 12:00:13

标签: javascript jquery html

我试图使用document.write来创建将链接到函数的html元素。但是我得到了:

SyntaxError: missing ) after argument list"

document.write也在for循环内,因为它需要为每个数据动态创建链接。

standardArray[i] = '<a href ="javascript:void(0);" onclick = "showDetails(null, null, ' + stdata.rows.item(i).Title + ');">' + stdata.rows.item(i).StandardNumber + ' ' + stdata.rows.item(i).Title;
document.write(standardArray[i]);

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

我假设CORNEAL CALCIUM CHELATION是一个字符串,因此您需要按以下方式设置onclick的格式:

doubles(List1,List2)