向结果页面提交数据

function (Data, url) {
            if (url == undefined || url == null || url == "") {
                url = "/Home/Result"
            }
            var temp_form = document.createElement("form");
            temp_form.action = url;
            temp_form.target = "_self";
            temp_form.method = "post";
            temp_form.style.display = "none";
            for (var x in Data) {
                var opt = document.createElement("input");
                opt.id = x;
                opt.type = "text"
                opt.name = x;
                opt.value = Data[x];
                temp_form.appendChild(opt);
            }
            document.body.appendChild(temp_form);
            temp_form.submit();
        }

  

原文地址:https://www.cnblogs.com/valeb/p/7989321.html