📜  javascript on the fly form submit - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:51.762000             🧑  作者: Mango

代码示例1
function post_to_url(path, method) {
    method = method || "post";

    var form = document.createElement("form");
    form.setAttribute("method", method);
    form.setAttribute("action", path);
    
    document.body.appendChild(form);
    form.submit();
}