/* AntiCSRF Implementation Alpha this implementation will handle all click and submit events causing to the form */ $("form") .submit(function (e) { var $antiCSRFInput = $("#__antiCSRF"); if ($antiCSRFInput.val() === "") { $.ajax({ url: "/q4api/v3/anticsrf", type: "GET", async: false, success: function (token) { if (token) { $("#__antiCSRF").val(token); if (typeof (WebForm_OnSubmit) === "function") return WebForm_OnSubmit(); return true; } else return false; }, error: function () { return false; } }); } else { if (typeof (WebForm_OnSubmit) === "function") return WebForm_OnSubmit(); return true; } }); /* AntiCSRF Implementation Beta this implementation is for