String = "modifyText('<table><tr><td><a href=http://... onclick=alert()>test</a></td></tr><table>')";
String = "modifyText('<table><tr><td><a href=http:\\\\... onclick=alert()>test</a></td></tr><table>')";
String = "modifyText('<table><tr><td><a href=http:\\\\... onclick=alert()>test</a></td></tr><table>')";
不可以吗???
strGlobal += "<a href='#' onclick=showOtherFile()>" + m +
"</a>" + " " + " ";
strGlobal += "</div>";
strGlobal += "<tr><td align=left width=350 height=35 vAlign=center><a href=" +
escape(FilePath[k]) + " target=_blank>" + FileNameArr[k] +
"</a></td><td align=center width=200 height=35 vAlign=center>" +
FileLastModiArr[k] + "</td><td align=center width=80 height=35" +
" vAlign=center><a href=" + escape(FilePath[k]) + " target=_blank" +
" onclick=alert()>" + "下载</a></td></tr>";
var strHref="<tr><td><a href='#' ";
strHref += " onclick=\"modifyText('"+ strGlobal + "');changeFolderIcon("+i+","+FolderTotal+")\">";
strHref += " <img id="+"img" + i + " align=\"absmiddle\" src=\"img/folder.gif\" border=0>";
strHref += objSubFolder.Name;
strHref += "</a></td></tr>";
Response.Write(strHref);其中m,FileNameArr[k],FileLastModiArr[k],strGlobal,i,FolderTotal,objSubFolder.Name为参数,modifyText,changeFolderIcon,showOtherFile为自定义函数,我现在需要在onclick=showOtherFile()添加传出参数,而且我记得onclick="showOtherFile()"才是标准,还需要在onclick=alert()中添加警告语句。请问如何给onclick=showOtherFile()和onclick=alert()添加单双引号才正确。
strGlobal += ... + "onclick=" + strOnclick + ...