📜  onload 仅提交一次表单 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:46.529000             🧑  作者: Mango

代码示例1
function submit() {
    if (!sessionStorage.getItem("submitted")) {
        console.log("submitting");
        sessionStorage.setItem("submitted", "true");
        document.getElementById("post").submit();
    } else {
        console.log("already submitted, not repeating");
        sessionStorage.removeItem("submitted");
    }
}