The function is very practical and the code is very simple, so I won’t waste any more nonsense and just present it:
$.ajax({ url:"mobileSurveyAction_addSurvey.action",//提交地址 data:$("#form1").serialize(),//将表单数据序列化 type:"POST", dataType:"json", success:function(result){ if (result.success == '100'){ $("#mySection").hide(); $(".footer").hide(); $("#alertMsg").show(); }else{ alert("失败!"); } } });
The above is the entire content of this article. I hope it will help everyone master the asynchronous submission form.
Please take a moment to share the article with your friends or leave a comment. We will sincerely thank you for your support!