js 模拟表单提交

var form = $("<form>");
        form.attr("style", "display:none");
        form.attr("target", "");
        form.attr("method", "post");
        form.attr("action", "/dev/titan2/DownloadSmpZip");
        var input1 = $("<input>");
        input1.attr("type", "hidden");
        input1.attr("name", "smp_ids");
        input1.attr("value", ids);
        var input2 = $("<input>");
        input2.attr("type", "hidden");
        input2.attr("name", "tsk_id");
        input2.attr("value", gtask_now.id);
        $("body").append(form);
        form.append(input1);
        form.append(input2);
        form.submit();
        form.remove();
posted @ 2020-06-20 15:12  唯爱金生  阅读(745)  评论(0编辑  收藏  举报