日期:2014-05-16 浏览次数:20568 次
<script type="text/javascript" src="/js/jquery.js"></script> <script type="text/javascript"> $().ready(function() { $("#submit").click(function() { $.ajax({ url : "insertUser", data : $("form").serialize(), type : "POST", dataType : "text", complete : function() {location.href = "main.html"} }); } } </script>
<body> <form name="insertUser" method="post" action="main"> 用户名:<input type="text" name="userId" id="userId" /> 密码:<input type="password" name="staticPassword" id="staticPassword" /> <input type="button" id="submit" value="提交" /> </form> </body>