zoukankan      html  css  js  c++  java
  • Flask 交互

    <a href="{{url_for('test')}}">我是测试</a>
    
    <button onclick="window.location.href='{{ url_for("test") }}'">点我啊</button>
    
    <button onclick="{{ url_for("test") }}">点我啊</button>#这是错误的哦
    
    <script>
        function testclick(name)
        {
            //window.location.href="{{ url_for("test") }}";
            window.open("{{ url_for("test") }}","_self");
        }
    </script>
    <button onclick="testclick('屋')">点击我啊</button>
    
    ------------------------------------------------------------------------
    
    $.ajax({
                    url:'/test',
                    type:'POST',
                    data:JSON.stringify({'username':'js','psw':'123456789'}),                #或者data: {jsdata: JSON.stringify({'username': 'js','psw': '132456789'})},
                    #或者data:{'username':'js','psw':'123456789'},                #或者data:"username=js&psw=123",
                    dataType: 'json',
                    success:function(res){
                        console.log(res)
                        console.log(0)
    
                    },
                    error:function (res) {
                        console.log(res);
                        console.log(1)
                    }
                })
    

      

  • 相关阅读:
    tnagios
    python-gearman使用
    yaml
    中国大陆互联网国际出口情况(2015年)
    vsftpd配置
    spoj-ASSIGN-bitDP
    spoj-ANARC05H -dp
    Light oj 1379 -- 最短路
    SPOJ-394-ACODE
    2018年东北农业大学春季校赛
  • 原文地址:https://www.cnblogs.com/pythonClub/p/15333953.html
Copyright © 2011-2022 走看看