var form = $("<form>");
form.attr("style","display:none");
form.attr("target","");
form.attr("method","post");
form.attr
("action",rootPath + "T_academic_essay/DownloadZipFile.do");
var input1 = $("<input>");
input1.attr("type","hidden");
input1.attr("name","strZipPath");
input1.attr("value",strZipPath);
$("body").append(form);
form.append(input1);
form.submit
();
form.remove();
a. html 代码
<form action="" id="fileForm" method="post" style="display: none;"></form>
b.
js 代码
<scriptype="text/javascript">
$("#download").click(function(){
var url="/downloads/ajax/file";//下载文件
url
$("#fileForm").attr('action',url);
$("#fileForm").submit();
});
</script>