jQuery用户从服务器端注册登录
2016-10-09 16:53
232 查看
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>用户登录</title> <script src="jquery-3.1.0.js"></script> </head> <body> <form> <label>账户</label><input type="text" class="name loginName" name="username"> <label>密码</label><input type="password" class="password loginPassword" name="password"> <input type="button" value="提交" id="submit"> <a value="登录" id="login">登录</a> </form> <script> $("#submit").click(function (e) { e.preventDefault(); $.ajax({ url: "http://datainfo.duapp.com/shopdata/userinfo.php", method: "POST", dataType: "json", data: { status: "register", userID: $(".name").val(), password: $(".password").val() }, success: function (data) { console.log(data) }, error: function () { console.log("error") } }) }); $("#login").click(function (e) { e.preventDefault(); $.ajax({ url: "http://datainfo.duapp.com/shopdata/userinfo.php", method: "POST", dataType: "json", data: { status: "login", userID: $(".loginName").val(), password: $(".loginPassword").val() }, success: function (data) { console.log(data); }, error: function () { console.log("error"); } }); }) </script> </body> </html>
相关文章推荐
- 使用jquery1.2.6验证用户登录和注册总结
- 用户登录注册页面jQuery验证
- node.js后台jquery前台-- 实现用户登录注册AJAX交互
- 用户注册和登录案例(服务器端:数据控制,业务层,dao层)
- 使用Forms Authentication实现用户注册、登录 (三)用户实体替换
- 图文演示Flash+ASP实现用户登录/注册程序第1/2页
- Ajax在用户注册表单和用户登录表单方面应用 [转帖]
- 在jsp中用bean和servlet联合实现用户注册、登录
- 如何在用户注册或登录时使用验证码图片
- 使用Forms Authentication实现用户注册、登录 (一)基础知识
- 使用Forms Authentication实现用户注册、登录 (二)用户注册与登录
- 使用Forms Authentication实现用户注册、登录 (三)用户实体替换
- 使用Forms Authentication实现用户注册、登录 (三)用户实体替换
- 使用Forms Authentication实现用户注册、登录 (一)基础知识
- 使用Forms Authentication实现用户注册、登录 (二)用户注册与登录
- 如何在用户注册或登录时使用验证码图片(转)
- .NET2.0下CommunityServer21新注册用户成功,注销重新登录失败的问题
- Asp.net2.0身份验证技术学习入门---新用户注册,登录,显示用户信息
- 如何在用户注册或登录时使用验证码图片
- 使用Forms Authentication实现用户注册、登录