代码块见下,个中 test 为a 标签的Id。以下两种办法都无法实行点击操作
$(34;#test").trigger("click");$("#test").click();
改进方法,JSP代码,见下代码块,在<a>标签下,再建一个标签,然后调用子标签click方法即可
<a id="batchDownloadResult" href="#" style="display:none"><span id="batchDownloadResultSpan">download</span></a>
JS 调用代码块见下
var url = _ctxPath+"/rest/attachment/file/batchDownload/"+ids+"?zipFileName="+Date.now();$("#batchDownloadResult").attr("href",url);$("#batchDownloadResultSpan").trigger("click");