js from

function js_post(URL, PARAMS) {
        var temp = document.createElement("form");
        temp.target = "_blank";
        temp.action = URL;
        temp.method = "post";
        temp.style.display = "none";
        for (var x in PARAMS) {
        var opt = document.createElement("textarea");
        opt.name = x;
        opt.value = PARAMS[x];
        temp.appendChild(opt);
        }
        document.body.appendChild(temp);
        temp.submit();
    }

    //打印订单
    $('.js-print-order').live('click', function(e){

        var order_id = $(this).attr('data-id');
        js_post(print_order_url, {'order_id' :order_id});
    })
原文地址:https://www.cnblogs.com/lujiang/p/8404700.html