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

Jquery asynchronous submission form code sharing_jquery

WBOY
Release: 2016-05-16 16:07:28
Original
1058 people have browsed it

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("失败!");
          }
        }
      });
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template