我试图使用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]);
有什么想法吗?
答案 0 :(得分:1)
我假设CORNEAL CALCIUM CHELATION是一个字符串,因此您需要按以下方式设置onclick的格式:
doubles(List1,List2)