前端js的form表单提交的方法

 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();//表单提交

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值