0 == $("#ExcelForm").length && $(document.body).append('<form target="ExcelIframe" id="ExcelForm">'
+'<input type="hidden" id="Excel_queryKey" name="processIds" />'
+'</form><iframe name="ExcelIframe" style="display:none; visibility: hidden;"></iframe>');
$("#Excel_queryKey").val(processId);
var b = document.getElementById("ExcelForm");
b.method = "post";
b.action = "<%=request.getContextPath()%>/process/data/download.do";
b.submit();
function downloadFile(actoinURL,filePath,fileName){
var form = $("<form>");
$('body').append(form);
form.attr('style','display:none');
form.attr('target','');
form.attr('method','post');
form.attr('action',actoinURL);
var input1 = $('<input>');
input1.attr('type','hidden');
input1.attr('name','filePath');
input1.attr('value',filePath);
form.append(input1);
var input2 = $('<input>');
input2.attr('type','hidden');
input2.attr('name','fileName');
input2.attr('value',fileName);
form.append(input2);
form.submit();
};
- 设定要提交的参数在input中
- 设置提交方式(post/get)
- 设定action
- 提交