ajax表单校验
var formData = new FormData(document.querySelector("#guestbook_form")); $.ajax({ url: "/send_submit", type: 'post', data: formData, processData: false, contentType: "application/x-www-form-urlencoded", dataType: "json", success: function(response) { if (response.code == 200) { // showAlertMsg(response.msg); alert(response.msg); location.reload(); } else { // alert(33); return false; showAlertMsg(response.msg); } } });