Home  >  Article  >  Web Front-end  >  Jquery asynchronous submission form code sharing_jquery

Jquery asynchronous submission form code sharing_jquery

WBOY
WBOYOriginal
2016-05-16 16:07:281040browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn