美文网首页
reg.jsp-ajax

reg.jsp-ajax

作者: 金厚琦 | 来源:发表于2018-11-24 17:02 被阅读0次
    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>***欢迎进入注册界面***</title>
    <script src="js/jquery-1.11.2.min.js"></script>
    <script>
    $(function(){
        $("#aaa").click(function(){
            $.ajax({
                   type: "POST",
                   url: "<%=request.getContextPath()%>/regservlet",
                   data: $("#form1").serialize(),
                   success: function(msg){
                // alert( "Data Saved: " + msg );
                $("#result").html(msg);
                   }
                });
        })
        
        
    })
    
    </script>
    </head>
    <body>
    <form id="form1">
    用户名:<input type="text" name="name"><br>
    密码:<input type="password" name="password"><br>
    验证密码:<input type="password" name="repeatpwd"><br>
    邮箱:<input type="email" name="email"><br>
    <input type="button" id="aaa" value="提交"> <input type="reset" id="bbb"><br>
    
    </form>
    <span id="result"></span>
    </body>
    </html>

    相关文章

      网友评论

          本文标题:reg.jsp-ajax

          本文链接:https://www.haomeiwen.com/subject/lnjyqqtx.html