我希望保持跨浏览器的兼容性,并且这是迄今为止唯一的问题。
.setAttribute("onclick", "return showRapidText("+itemnum+");");
这很完美,但我想通过把它放在这个语法中使它与 IE 兼容
.onclick = new Function("fnDisplay_Computers('" + alines[i] + "')");
所以...我试过了
.onclick = new Function("showRapidText('" + itemnum + "')");
和
.onclick = new Function("return showRapidText('" + itemnum + "')");
还有大约 40 种其他方法,但没有任何效果