<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                [TOC=1,5] >[success] # ajax 寫法 >[danger] ##### views ~~~ from django.shortcuts import render,redirect,HttpResponse import json from . import models from . import account # Create your views here. def login(request): if request.method == "GET": obj = account.loginFrom() return render(request,'login.html',{'obj':obj}) if request.method == "POST": ret = {'status':True,'message':None } obj = account.loginFrom(request.POST) valid = obj.is_valid() if valid: models.userinfo.objects.filter(**obj.cleaned_data) return HttpResponse(json.dumps(ret)) ret['status'] = False ret['message'] = obj.errors return HttpResponse(json.dumps(ret)) ~~~ >[danger] ##### html 這個ajax 判斷不能直接用只是一種思路 ~~~ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <form id="fm"> {% csrf_token %} <p>{{ obj.user }}<span class="us_error"></span></p> <p>{{ obj.pwd }}<span class="pw_error"></span></p> <input id="btn" type="button" value="提交按鈕"> </form> <script src="/static/jquery-1.12.4.js"></script> <script src="/static/jquery.cookie.js"></script> <script> $(function () { BindSumbit(); }); function BindSumbit() { $('#btn').click( function () { $.ajax({ url:'/login.html', type:"POST", data:$("#fm").serialize(), dataType:'JSON', success:function (arg) { if(arg.status){ window.location.href="http://www.baidu.com" }else{ $('.us_error').text(arg.message.user[0]); $('.pw_error').text(arg.message.pwd[0]) } } }) } ) } </script> </body> </html> ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看