多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
>[success] # html 写法 ~~~ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <link href="/static/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet"></link> <style> div.register{ height: 500px; width: 500px; border: 1px solid; } .register h1{ text-align: center; } .title{ font: 700 16px/40px 微软雅黑 ; color: black; } .username,.nickname,.email,.password,.confirm_password{ width: 250px; } </style> <body> <div class="container register"> <form id="registerfrom"> {% csrf_token %} <h1>用户注册</h1> <div class="row"> <div class="col-lg-3 title">用户名</div> <div class="col-lg-9"> {{ login_form.username }} <span id="form-user-error" class="erro" ></span> </div> </div> <div class="row"> <div class="col-lg-3 title">密&nbsp码</div> <div class="col-lg-9"> {{ login_form.password }} <span id="form-pwd-error" class="erro" ></span> </div> </div> <div class="row"> <div class="col-lg-2 title">验证码</div> <div class="col-lg-5">{{ login_form.code }}</div> <div class="col-lg-5"><img src="/checkcode.html/" id="code" onclick="chagecode(this)"></div> <span id="form-code-error" class="error" ></span> </div> <div> 一个月免登陆{{ login_form.check_box }} </div> <div> <a id="submit" class="btn btn-info" style="float: right;margin:15px 15px "> 登陆</a> </div> </form> </div> <script src="/static/js/jquery-1.12.4.js"></script> <script src="/static/plugins/bootstrap/js/bootstrap.min.js"></script> <script> $(function () { SubmitBind(); }); // 验证码 function chagecode(ths) { ths.src = ths.src + "?"; }; function SubmitBind() { $("#submit").click( function () { $.ajax({ url:"/login.html/", method:"POST", data:$('#registerfrom').serialize(), dataType:"JSON", success:function (arg) { if(arg.status){ location.href="/register.html" }else{ var img = $('#code')[0]; img.src = img.src+"?"; $(".error").text(arg.message) } } }) } ) } </script> </body> </html> ~~~