var form = $("<form>");//创建form表单
form.attr("style","display:none");
form.attr("method","post");
form.attr("action","<%=request.getContextPath()%>/common/excel");//访问路径
var pageIndex_input = $("<input>");//创建input
/* pageIndex_input.attr("tyle","hidden");
pageIndex_input.attr("name","excel_input");
pageIndex_input.attr("value",JSON.stringify(reqData)); */
var path_input = $("<input>");
var bigeyeIP_input = $("<input>");
var usage_input = $("<input>");
var activity_label_input = $("<input>");
var fileName_input = $("<input>");
//添加参数
pageIndex_input.attr("tyle","hidden");
pageIndex_input.attr("name","pageIndex");
pageIndex_input.attr("value",pageIndex);
bigeyeIP_input.attr("tyle","hidden");
bigeyeIP_input.attr("name","bigeyeIP");
bigeyeIP_input.attr("value",bigeyeIP);
usage_input.attr("tyle","hidden");
usage_input.attr("name","usage");
usage_input.attr("value",usage);
activity_label_input.attr("tyle","hidden");
activity_label_input.attr("name","activity_label");
activity_label_input.attr("value",activity_label);
path_input.attr("tyle","hidden");
path_input.attr("name","path");
path_input.attr("value","/"+common_url+"/BigeyeServer/excel?");
fileName_input.attr("tyle","hidden");
fileName_input.attr("name","fileName");
fileName_input.attr("value","Bigeye Server");
$("body").append(form);
form.append(bigeyeIP_input,usage_input,activity_label_input,path_input,fileName_input);
form.submit();//表单提交
前端js的form表单提交的方法
最新推荐文章于 2023-08-18 17:32:13 发布